Advertisement
Umme_nishat

problem-8

Jun 28th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.13 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=1;i<=n;i+=2){
  7. sum+=i;}
  8. printf("%d\n",sum);
  9. return 0;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement