Advertisement
Guest User

C program

a guest
Jan 24th, 2016
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include <stdio.h>
  2. int g(int n){if(n<=1)return 0;int i;for(i=2;i*i<=n;i++){if(n%i==0){return 0;}}return 1;}main(){int h,i=0,c=0;printf("Output:");scanf("%i",&h);while(c!=10){if(g(i)){printf("Prime %i\n", i);c++;}i++;}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement