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