Advertisement
sathi_talukder

Untitled

Feb 22nd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,n,sum=0;
  5. scanf("%d",&n);
  6. for(i=0;i<=n;i++)
  7. {
  8. if(i%2==0)
  9. sum=sum+i;
  10. }
  11. printf("%d\n",sum);
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement