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]
2 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]2 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
The director of HR realizes that the KSAs currently used for hiring entry-level engineers are outdated. In order to establish wh
Vaselesa [24]

Answer:

Job analysis

Explanation:

The HR should preferably use job analysis.

6 0
3 years ago
How many jobs can you get without a college degree
larisa86 [58]
The 10 highest-paying jobs you can get without a college degree all pay more than $79,000 those are Commercial pilots.
Detectives and criminal investigators. ...
Powerhouse, substation, and relay electrical and electronics repairers. ...
Elevator installers and repairers. ...
Power plant operators. ...
Media and communication equipment workers. ...
7 0
3 years ago
Read 2 more answers
What happens when the programmer tries to access an array cell whose index is greater than or equal to its logical size?
just olya [345]

Answer:

When a programmer tries to access an item in an array cell whose index is greater than or equal to the array's logical size, this data element or item is garbage. This means that currently, the item is not the part of the program's useful data. Garbage contains objects or data which will not be used by a program running on it. So the value returned could be either of the two:

  • Value would be an arbitrary or random number if it is an array of numbers. Arbitrary means that the value is not predefined or specified in advance.
  • Value returned would be null if it is an array of objects.

                                                           

 

3 0
3 years ago
Identify an advantage of working in teams.
ra1l [238]

If you're on apex and you have the answer choice

A: Less wasted time

B: Less skills

C: Strong work ethics

D: More ideas

Then D is the answer

7 0
2 years ago
grow a sentence frame a small and simple sentence. then expand it. Expand this sentence -I am a gril​
AlekseyPX

Answer:

I am a young lady.

Explanation:

simply sentence or expand more:

  • I am a young lady in my teens. ​
  • I am a young woman in her twenties. ​
  • I am a twenty-year-old lady who is just starting off in life. ​
  • I am a twenty-year-old woman who is just getting her feet wet in the world. ​
6 0
3 years ago
Read 2 more answers
Other questions:
  • Typically, a dvd has how many times more capacity than a cd?
    5·1 answer
  • What type of organizational structure would you want to use for this company (by function, by process, by product, and so on)? E
    11·1 answer
  • What does ADF means????
    13·2 answers
  • When did economies begin?
    11·2 answers
  • When using a file name you have to use only lower case letters<br>true or false
    11·1 answer
  • What are the top and side margins for a letter typed in standard format?
    5·1 answer
  • CAD workstations
    11·1 answer
  • Choose and explain, step by step, one method of backing up student files either manually or using a cloud service.
    10·1 answer
  • Anybody wanna be friends?
    10·2 answers
  • What is the purpose of a report?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!