Advertisement
S_h_u_v_r_o

Sum of prime

Nov 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int a,b,c,d,e=0,f=0,g=0;
  6. scanf("%d %d",&c,&d);
  7. for(a=c;a<=d;a++)
  8. {
  9. for(b=1;b<=a;b++)
  10. {
  11. if(a%b==0)
  12. {
  13. e++;
  14. }
  15. }
  16. if(e==2)
  17. {
  18. f+=a;
  19. g++;
  20. }
  21. e=0;
  22. }
  23. printf("%d %d\n",g,f);
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement