• worldeye
  • Category Uncategorized
/*Program for Prime Number Generation*/

#include 
main()
{
int n,i=1,j,c;
clrscr();
printf("Enter Number Of Terms");
printf("Prime Numbers Are Following");
scanf("%d",&n);
while(i<=n)
{
c=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
c++;
}
if(c==2)
printf("%d ",i)
i++;
}
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *