Home > Back-end >  The output of prime Numbers within 1000, 10 in a row.
The output of prime Numbers within 1000, 10 in a row.

Time:01-25

# include "stdio.h"
Int prime (int n)
{
Int I, flag=1;
for(i=2; iIf I (n %==0)
{
Flag=0;
break;
}
Return (flag);
}
The main ()
{
Int a, n=0;
For (a=2; A. & lt;=1000; +)
{
If (prime (a)==1)
{
Printf (" % 5 d ", a);
N++;
If (n % 10==0)
printf("\n");
}
}
}

CodePudding user response:

Read, make persistent efforts,
  • Related