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
Define the term hardwar<br><br>​
bezimeni [28]

Answer:

tools, machinery, and other durable equipment.

Explanation:hardware in a computer are the keyboard, the monitor, the mouse and the central processing unit.

4 0
3 years ago
Read 2 more answers
In every organization, workers receive and sendinformation daily. The flow of this information should be____________.upward and
Aleks [24]

Answer:

upward and downward

Explanation:

4 0
4 years ago
FOR A BRAINLIEST
Ludmilka [50]

A sample word problem to calculate the volume and surface area of a three-dimensional object would be: "A logistics company has a wide area that is 300m^2 and has a parking space that is 50m in height and is 12 feet long. Find the volume of the parking space"

<h3>What is a Word Problem?</h3>

This refers to the use of words that describes a real scenario that would lead to a mathematical calculation.

Hence, to make a sample word problem based on the given description, the above description should be helpful, and remember that \pi is 3.142 when doing your calculations.

Read more about word problems here:

brainly.com/question/13818690

#SPJ1

7 0
2 years ago
If you wanted to create a line of code that would add ten to the user’s current score, which code should you use?
Korvikt [17]

Answer:

choice c

Explanation:

score = score + 10

because the rest doesn't make since and score == score + 10 has an extra equal sign.

7 0
3 years ago
Read 2 more answers
Read the following scenario: A project will require more people than originally estimated. Identify the possible risks to the pr
egoroff_w [7]
A ideas and creativity
8 0
4 years ago
Read 2 more answers
Other questions:
  • In Microsoft Word, when you highlight existing text you want to replace, you are in what
    11·1 answer
  • …………………..is made upof plastic or glass fibers that transmit data at very fastspeeds.
    10·1 answer
  • Pls Help Me!!!!!!!!!!! It won’t work when I connect to ITunes!
    12·1 answer
  • What is TLB for? Why TLB? Given the following number, what is theeffective memory access time?
    11·1 answer
  • IDE devices require the use of a controller mounted on the motherboard. True False
    14·2 answers
  • Which programming element is used by a game program to track and display score information?
    10·2 answers
  • Select the correct word to complete the sentence.
    8·1 answer
  • What is missing in the following program in order to have the output shown?
    15·2 answers
  • PYTHON HW PLEASE HELP. I NEED THE ACTUAL CODE!!! 100 POINTS AND BRAINLIEST. REPORTING IF YOU DON'T ANSWER
    11·1 answer
  • HOW TO DISCONNECT A MONITOR FROM A SYSTEM UNIT
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!