Question: C++ program Rewrite main so that it tests all the numbers from 2 to 10 (inclusive) and prints out the results, each on a separate

 C++ program Rewrite main so that it tests all the numbers
C++ program

Rewrite main so that it tests all the numbers from 2 to 10 (inclusive) and prints out the results, each on a separate line. (Hint: Use a for loop, with i running from 2 to 20.) Desired output: 2 is prime 3 is prime 4 is not prime 5 is prime 6 is not prime 7 is prime 8 is not prime 9 is not prime 10 is not prime

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!