Question: Write a C++ program named prime.cpp that displays all the prime numbers (display one prime number per line) between 2 and 200. It is required

 Write a C++ program named prime.cpp that displays all the prime

Write a C++ program named prime.cpp that displays all the prime numbers (display one prime number per line) between 2 and 200. It is required that your program defines a user defined function named IsPrime. This function takes one integer type value as its input parameter, and determines whether this integer value is a prime number or not. It returns a value "true" if the number is a prime number, and returns a value "false" if it is not prime. The main function in your program should consist of a loop that iterates through the numbers from 2 to 200. For each of these numbers, call the function "IsPrime" to determine ifit is a prime number. Display the value if it is a prime number

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!