Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  h1
Language: C/C++
Code:
#include <stdio.h>
#include<stdlib.h>
#include<conio.h>
int k;int c=0;int j=1;
void prime(int);
int main()
{
     scanf("%d",&k);
prime(1);
getch();
     return 0;
}
     void prime(int i)
{if(i%j==0)
  {c=c+1;}
if(c>2){i=i+1;j=1;c=0;prime(i);}
if(k==0){exit(1);}
if(j<=i){j=j+1;prime(i);}
if(c==2&&k!=0){k=k-1;printf("%d is prime",i);c=0;i=i+1;j=1;prime(i);}
else{i=i+1;j=1;prime(i);}
}     
          
          
          
Comments: