/* Write a C Program to generate n prime number by defining isprime () function*/ #include< stdio.h> #include< conio.h> int isprime(int n){ int m=0,i; m=n/2; for(i=2;i<=m;i++) { if(n%i==0) { // printf("Number is not prime"); return 1; } } return 0; } void main(){ int j,n,i,m=0,flag=0; printf("PRINT N prime number from 1 to N:"); scanf("%d",&n); for (j=0;j< n;j++){ flag= isprime(j); if(flag==0) printf("\n %d",j ); } getch(); }