1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
icang [17]
3 years ago
11

#Write a function called is_composite. is_composite should #take as input one integer. It should return True if the #integer is

composite, False if the integer is not not #composite. You may assume the integer will be greater than #2 and less than 1000.
Computers and Technology
1 answer:
malfutka [58]3 years ago
3 0

Answer:

// A optimized school method based C++ program to check  

// if a number is composite.  

#include <bits/stdc++.h>  

using namespace std;  

bool isComposite(int n)  

{  

// Corner cases  

if (n <= 1) return false;  

if (n <= 3) return false;  

// This is checked so that we can skip  

// middle five numbers in below loop  

if (n%2 == 0 || n%3 == 0) return true;  

for (int i=5; i*i<=n; i=i+6)  

 if (n%i == 0 || n%(i+2) == 0)  

 return true;  

return false;  

}  

// Driver Program to test above function  

int main()  

{  

isComposite(11)? cout << " true\n": cout << " false\n";  

isComposite(15)? cout << " true\n": cout << " false\n";  

return 0;  

}

Explanation:

You might be interested in
Write a program that converts or calculates values. Use the following guidelines to write your program:
Setler [38]

Answer:

In Section 2.2 “Expressing Units”, we showed some examples of how to ... with other units of the same type to get a numerical value that is easier to comprehend. ... The rules of algebra say that you can change (i.e., multiply or divide or add or ... We see that one-half of a yard equals 3/2, or one and a half, feet—something Explanation:

8 0
3 years ago
A type of graph that uses horizontal bars to compare data is called a
sergiy2304 [10]
The answer is A) a bar graph

6 0
3 years ago
Read 2 more answers
Check My Work _____ are made in response to situations that have occurred frequently enough to enable managers to develop decisi
enot [183]

Answer:

a. Programmed decisions

Explanation:

We basically have two types of decision:

  • Programmed decision
  • Non-Programmed decision

Programmed Decision: used for frequent situations of the organization; both internal and external. This decision results in the formulation of rules, procedures, and policies that can be applied in the future.

Non-Programmed Decision: used for unique and ill-structured situations of the organization; both internal and external. They are one-shot decisions. They have been handled by techniques such as judgment, intuition, and creativity.

8 0
3 years ago
Choose all of the items that represent functions of the operating system kernel.
babunello [35]

Answer: its all of them

Explanation: I took Assignment over this

6 0
3 years ago
Read 2 more answers
The Security Development Life Cycle (SDLC) is a general methodology for the design and implementation of an information system.
navik [9.2K]

Answer:

False

Explanation:

The Security Development Life Cycle (SDLC), is a software development which involves traditional approach towards its design such as, waterfall model, Agile, etc.

It can either be referred to as a generic secure development life cycle or a specific one, such as the Microsoft SDL or the Cisco SDL.

Its phases includes,

A1 - Security Assessment

A2 - Architecture

A3 - Design and Development 1

A4 - Design and Development 2

A5 - Ship

PRSA - Post Release

Each phase talks about how a secured software is developed.

The Security Development Life Cycle (SDLC) is a general methodology for the design and implementation of an information system. This statement is false because by definition and attributes Security Development Life Cycle is a traditional approach towards software development and not a general method.

6 0
3 years ago
Other questions:
  • You're working at a large industrial plant and notice a tag similar to the one shown in the figure above. Which of the following
    5·1 answer
  • kevin is working on a financial project that involves a lot of statistical information. He needs software that allows him to ent
    8·2 answers
  • How can you tell that you're driving in the right direction?
    14·1 answer
  • An
    9·1 answer
  • The sample remote access policy document from the hospital that you reviewed in the lab showed that the Remote Access Domain is
    15·2 answers
  • Is the following statement TRUE or FALSE?
    9·1 answer
  • Direction: using the data at the left, answer the questions that follows.​
    11·1 answer
  • Edge is a video game featuring interactive extreme sports. The graphics used in the game are protected by
    8·1 answer
  • Find out about the different technological solutions available for interconnecting LANs to from larger networks such as wide are
    5·1 answer
  • Cyber vulnerabilities to dod systems may include
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!