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
What three processor technologies are required to install windows 8?
VashaNatasha [74]
The three processor technologies that are required to be able to install windoes 8 are NX, PAE  and SSE2. PAE stands for physical address extension, NX would NoeXecute and SSE2 means Streaming SIMD Extentions 2. The PAE is the one that enables 32bit processors to be able to access 4 GB and above of memory. NX would help guard the computer from malwares. Lastly, SSE2 is a set of instructions that is used by third party drivers and apps.
5 0
4 years ago
The concept of ____ refers to the idea that the internet is designed for all content to be treated equally.
vitfil [10]
Net neutrality buddy boi
3 0
3 years ago
Best location to install a patch panel?
sergejj [24]

Answer:

Explanation: In general, there are three positions for the patch panel to install in the stand column of rack, which depends on your cabling. When adopting ground outlet, the cables usually enter inside the rack from its bottom. So the patch panel should be mounted in the lower part inside the rack.

8 0
3 years ago
Which example best describes a school consequence for committing plagiarism?
sergij07 [2.7K]

Answer:

1

Explanation:

6 0
4 years ago
Bbbbbbbbbbbbbbbbbbbbbbbb
ira [324]

Answer:

ccccccccccccccccccccccccccccccccccccccccccccccc?

5 0
3 years ago
Read 2 more answers
Other questions:
  • Is motherboard a:<br><br> A.operating system<br> B.software<br> C.hardware<br> D.input device
    11·1 answer
  • Create a view named ItemOrder view. It consists of the TaskID, description, price, order number, order date, and quoted price fo
    8·1 answer
  • CIST 1122 Project 2 Instructions
    11·1 answer
  • Will a large computer monitor have a clearer picture than using my plasma tv screen?
    9·1 answer
  • Which of the following factors will have the greatest impact on your credit score? I. Length of Credit History II. Payment Histo
    6·2 answers
  • Hannah decides to burn her video portfolio to a DVD. She wants to hand it over to a movie producer she will meet at a social eve
    15·1 answer
  • Critique and rank four different brands of antivirus software, rating them by price, functionality, and system requirements. Pre
    14·1 answer
  • What kind of email formatting change can you make using the Rules Wizard?
    12·1 answer
  • A coffee shop is considering accepting orders and payments through their phone app and have decided to use public key encryption
    11·1 answer
  • State 10 differences between video conferencing and teleconferencing​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!