Link to home
Start Free TrialLog in
Avatar of wewe
wewe

asked on

Nearest prime number

How to write a C program to find a prime number nearest to an input interger num.
Avatar of rbr
rbr

Pls give more info. How many digits, what kind of algorithm to you want, is it a homework?
ASKER CERTIFIED SOLUTION
Avatar of yairy
yairy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> to gap between TWO primes...
Avatar of wewe

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.