int main(void) { int n, c = 2; printf("enter the value:"); scanf("%d",&n); for ( c = 2 ; c <= n - 1 ; c++ ) { if ( n%c == 0 ) { printf("not a prime number"); break; } } if ( c == n ) printf("prime number"); system("PAUSE"); return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)