Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void main(){
- int i,n,prim = 2;
- printf("n =");scanf("%d", &n);
- for(i = 0; i < n; i++){
- int contor = 2, ok = 1;
- while(contor <= prim/2){
- if(prim % contor == 0)
- ok = 0;
- contor++;
- }
- if(ok == 1)
- printf("%d ", prim);
- else
- n++;
- prim++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment