#include <stdio.h>
#include <conio.h>
int main()
{
int a, b, counter=0, limit=0, num;
printf("Enter number: ");
scanf("%d", &num);
for(a=1; a<=100000; a++)
{
counter=0;
for(b=2; b<a; b++)
{
if ((a%b)==0)
{
counter++;
}
}
if(counter==0)
{
printf("%d \n", a);
limit++;
}
if(limit==num)
{
break;
}
}
getch();
}
#include <conio.h>
int main()
{
int a, b, counter=0, limit=0, num;
printf("Enter number: ");
scanf("%d", &num);
for(a=1; a<=100000; a++)
{
counter=0;
for(b=2; b<a; b++)
{
if ((a%b)==0)
{
counter++;
}
}
if(counter==0)
{
printf("%d \n", a);
limit++;
}
if(limit==num)
{
break;
}
}
getch();
}