Apparently I am able to generate prime numbers from a given range and display them,today I was trying to add,multiply and subtract prime numbers without displaying all of them but rather by using a random generator to pick more than 5 random prime numbers and add them or subtract or multiply from a given range of 2-500. I have searched and i found this post but it doesn't answer my question. The rest I found are done in other languages. I don't want to have an array of the primes done manually.
Code;
for ( count = 2 ; count <= n ; )
{
for ( c = 2 ; c <= i - 1 ; c++ )
{
if ( i%c == 0 )
break;
}
if ( c == i )
{
printf("%d\n",i);
count++;
}
i++;
I really need help on how i can generate more than 5 random prime numbers and +,-,*
to get an answer..