I finally figured out how to write the code I originally thought I was posting
on the weekend.
The purpose of this small program is to identify prime numbers.
It seems to work okay until a number is entered that is divisible by 11
(or an elevenish type number). Example-- 33 is identified as prime,
777 is identified as prime, etc.
Any help or comments on this code will be appreciated.
Here's the code. Thanks everyone.
printf("Enter a number:\n");
for(a = 2; a < number; a++)
if((number % a) == 0)
printf("%d is not prime.\n", number);
if((number % a) != 0)
printf("%d is prime.\n", number);