Random Number Generator
HI .. i was wandering if i have a program that works out if it is prime or not, how do i generate random numbers for a prime number..
e.g, i have entered an integer say 2, then i work out if it is prime and i call the function isprime(x) or something...but i want to generate prime numbers less than equal to 128. how do i do that..
There is no way (not yet, at least) to generate a random prime number. What you could do is calculating all primes less than 128, store them in an array then pick a random element from that array, thus getting a random prime.