So I'm trying to make a program that generates twin prime numbers between 1 and 1000. I think I got it, but I can't stop the looping it goes on forever. Here's my code so far:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int a, c;
a=3;
c=2;
for (c=2; c<100; c++)
{
for (a=3; a != a%c; a++)
{
printf ("%d", a);
}
}
}
system("PAUSE");
return 0;
}
I'm a beginner in C so please help.