wewe
asked on
Nearest prime number
How to write a C program to find a prime number nearest to an input interger num.
Pls give more info. How many digits, what kind of algorithm to you want, is it a homework?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> to gap between TWO primes...
ASKER
To:rbr
Yes!It is my homework.
I have to write 2 function:
"isPrime" ~ find prime number,if the num is not a prime then return 0; else return 1.
"findPrime" ~ accept an interger and return a prime number which is nearest to it or the same as the given num.
The findPrime function should call the isPrime function to find the prime number.
Yes!It is my homework.
I have to write 2 function:
"isPrime" ~ find prime number,if the num is not a prime then return 0; else return 1.
"findPrime" ~ accept an interger and return a prime number which is nearest to it or the same as the given num.
The findPrime function should call the isPrime function to find the prime number.