Prime Numbers Series




Back
#include "stdio.h"

main()
{
int n,i=1,j,c;
//clrscr();
printf("Enter Number Of Terms: \n");
scanf("%d",&n);
printf("Prime Numbers Are Follwing\n");

while(i<=n)
{
c=0;
for(j=1;j<=i;j++)
{
if(i%j==0) c++;
}
if(c==2) printf("%d\t",i);
i++;
}
return 0;
}

No comments:

Post a Comment

There was an error in this gadget

Followers

About Me

Dhaka, Dhaka, Bangladesh
..