Question: c++ Write a program called IsPrime.cpp that generates a list of all prime numbers from 1 to 100 (inclusive). In your program, implement a function

c++c++ Write a program called IsPrime.cpp that generates a list of all

Write a program called IsPrime.cpp that generates a list of all prime numbers from 1 to 100 (inclusive). In your program, implement a function isPrime () that returns a Boolean value to indicate whether or not an input number is prime. Remember that a prime number is a number that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6 The program MUST contain the following features: A function isPrime (int num) that returns a Boolean value of true if num is a prime number or false if num is not a prime number. In main(), you must use your isPrime () function to generate a list of all prime numbers between 0 and 100 (inclusive) Hint: The mod operator (%) will tell you whether a number is evenly divisible by another number! A sample run of the program is shown below. The prime numbers between 1 and 100 are: 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 Press any key to continue

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!