Question: Write a C program that determines if a user entered integer is a prime number. A prime number is an integer greater than 1 that

Write a C program that determines if a user entered integer is a prime number. A prime number is an integer greater than 1 that can be divided evenly only by 1 or itself. Examples of prime numbers are: 3, 5, 7, 11 and 13. (Hint: Use a while loop and an if statement incorporating the modulo operator.) The output should look like the following with an explanation if it not a prime: Enter an integer to be tested if a prime number: 9 The number is not prime because it is divisible by 3

Enter an integer to be tested if a prime number: 5683 The number is a 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!