I m having trouble to find even, odd, and prime numbers with this question...
In this program you must use nested loops to print out the following details for each number from
3 to 100:
• Is it even or odd?
• Is it prime?
A number is prime if it is only divisible by itself and 1. So 3 is a prime, because it is only
divisible by 3 and 1. But 4 is not a prime, because it is divisible by 2.
2006-11-17
21:20:48
·
5 answers
·
asked by
tbwada
1
in
Computers & Internet
➔ Programming & Design
This is what i have rightnow, and i try to do a [even if], but it does not work at it all. Only thing it does is list the even, and prime number..
#include
int main()
{
int i;
printf("Printing information about numbers from 3-100...\n");
for( i = 3; i <= 100; i++){
printf("%d\n", i);
}
return 0;
}
2006-11-17
21:35:15 ·
update #1