N Prime

You might also like

You are on page 1of 1

#include<stdio.

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

You might also like