#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
{
int m,n, i, j,isprime,t,count=0;
clrscr ();
printf("n=");
scanf(%d",&n);
for (i=2; count<n; i++)
{
isprime=1;
t=sqrt(i);
for(j=2;j<=t;j++)
if(i%j==0)
{
isprime==0;
break;
}
if (isprime==1)
{
printf("%d",i);
count++;
}
}
getch();
}
No comments:
Post a Comment