Question: Write a C program prime that uses a brute force approach to find prime numbers. prime needs to keep track of the largest prime number
Write a C program prime that uses a brute force approach to find prime numbers.
prime needs to keep track of the largest prime number found so far.
Use the signal() function to provide a custom handler for the SIGINT signal.
When Ctrl-C is pressed, prime needs to do the following:
Print the largest prime number found so far;
Prompt the user whether to quit;
Accept exactly one character as the input without requiring the user to press Enter;
Quit if the user presses y or Y.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
