#include
#include
int main()
{
int i,j,n=0;
for(i=101;i<=200;i=i+2)
{
for(j=2;j<=sqrt(i);j++)
{
if (i%j==0)
break;}
if(j>sqrt(i))
{
n++;
printf("%d,",i);
if (n%5==0) printf("\n");
}
}
return 0;}
#include
#include
bool PrimeNumber(int iN)
{
for (int i=2; i<=sqrt(iN);i++)
{
if (iN%i == 0)
return false;
}
return true;
}
int main()
{
int iFirst = 100;
int iLast = 200;
int i, iCount=0;
for (i=iFirst; i{
if (PrimeNumber(i))
{
printf("%d\t", i);
iCount++;
if (iCount%5 == 0)
printf("\n");
}
}
printf("\nTotal number is: %d\n", iCount);
return 0;
}