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
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
Get step-by-step solutions from verified subject matter experts
