#include<stdio.h> #include<math.h> void main() { int m,k,i,n=0; for(m=101;m<=200;m=m+2) { k=sqrt(m); for(i=2;i<=k;i++) if(m%i==0) break; if(i>=k+1) { printf("%d",m); n=n+1; } if(n%10==0) printf("\n"); } printf("\n"); }
m
Quote:A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example, 5 is prime because only 1 and 5 evenly divide it, whereas 6 is composite because it has the divisors 2 and 3 in addition to 1 and 6
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)