mdnurnobihosen

Assignment3

Feb 24th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,n,sum=0;
  5.     printf("Enter any intiger number:");
  6.     scanf("%d",&n);
  7.     for(i=0; i<=n; i+=2)
  8.  
  9.         sum=sum+i;
  10.     printf("sum of all even numbers = %d\n",sum);
  11.     return 0;
  12. }
Add Comment
Please, Sign In to add comment