Question: Exercise 2: Write a C program to iteratively get an integer number from the user and determine if a given number is a prime number


Exercise 2: Write a C program to iteratively get an integer number from the user and determine if a given number is a prime number or not. (A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself (e.g., (2, 3, 5, 7, 11, 13, 17)). The iteration should stop if user enters 0. At the end also report the count of all the numbers entered by the user, and the count of those that are prime. Exercise 5: Write a C program to get an integer from the user, as day number, Number Day and display name of the day using the following table. If the number is negative, Monday program should show a proper prompt to the user and ask to enter a vlid number. Tuesday Valid number is a positive number. If the number entered is larger than 7, then 3 Wednesday program should compute the mod of that number and then show the Thursday corresponding day. The program should repeatedly work until user enters 0. For 5 Friday instance: Saturday Sunday If user enters 3, then program prints Wednesday. If user enters 12, then program should print Friday, because 12 mod 7 is 5. If user enters 21, then program prints Sunday. If user enters 0, then program prints a goodbye message and stops. 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
