Menu

Exercise 1Write A Program That Determines Whether A User-Given Number Is A Prime Number Or Not. Use Theadjacent Flowchart To Implement The Logic.Exercise 2Write A Program That Reads A Number Num In Therange Of 1 To 999999999 And A Digit N In The Rangeof 0 To 9 From The User (Write A Loop To Force Theuser To Enter Appropriate Values), Finds How

Write a program that determines whether a user-
given number is a prime number or not. Use the
adjacent flowchart to implement the logic.
Exercise 2
Write a program that reads a number num in the
range of 1 to 999999999 and a digit � in the range
of 0 to 9 from the user (write a loop to force the
user to enter appropriate values), finds how many
times the digit � occurs in the number num using a
while loop, and prints the output as shown.
Hint: Use / and % operators to get each digit from the number.
Sample Output:
Enter a number between 1 and 999999999
3545592
Enter a digit between 0 and 9
5
The digit 5 appears 3 time(s) in the number 3545592

student submitted image, transcription available

Expert Answer

Step 1

ANSWER:

“PROBLEM 1”:

CODE:

OR