Robert_Manea

erer

Nov 14th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int n,i,j,ok;
  7. scanf("%d",&n);
  8. for(i=1;i<=n;i++){
  9. ok=1;
  10. for(j=2;j<=i/2;i++)
  11. if(i%j==0)
  12. ok=0;
  13. if(ok==1)
  14. printf("%d",i);
  15. }
  16.  
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment