Saturday, December 26, 2009

How do I write a C program that displays all the prime numbers between 50 and 100?

I know it needs a ';for'; statement, and I know that the number(s) cannot be divisible by the divisors from 2 to the square root of the number. Also, don't use a clscr statement, or a cout statement. It's a C program, not C++.How do I write a C program that displays all the prime numbers between 50 and 100?
int main()


{


int iii;





for(iii = 50; iii %26lt; 100; iii++)


is(isPrime(iii))


printf(';%d is Prime \n';, iii);


return 0;


}

No comments:

Post a Comment