Question: Write a C program that finds the nth prime number and prints it on the screen. A prime number is a number that is only
Write a C program that finds the nth prime number and prints it on the screen. A prime number is a number that is only divisible by 1 and by itself. You need to create a function called FindPrime that obtains the value of n and returns the nth prime number to the main program. The prototype of your function is:
long FindPrime(int n);
The prime numbers are: 2 3 5 7 11 13 17 19 23 29 and so on.
For example, if the user enters 4, your program should print 7 because the 4th prime number is 7. Or if the user enters 7, your program should print 17 because 17 is the 7th prime number and so on.
if you can please explain. I am having a hard time understanding this :(
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
