Hi there. I've been asked to make a programme that finds and prints prime numbers. To do this, I set up a simple for loop that tests if the number can be divided by even or odd numbers.
I've now got stuck on the very simple problem that I can't make it actually print the numbers that satisfy my conditions. This is probly a really stupid problem but its been bugging me!Code:int main (void) { int i=0; int r=0; int numstatus1; int numstatus2; int status=0; char line[100]; while(1) { printf("Enter maximum number to count prime numbers to:\n"); fgets(line, sizeof(line), stdin); status=sscanf(line, "%d", &r); if (status==0) printf("Invalid number.\n"); else break; } for (i=0; i<r; i++) { numstatus1=0; numstatus2=0; numstatus1=i/2; numstatus2=i/3; if ??? printf("%d is prime", i); } return 0; }
Thanks in advance![]()


