Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i,n,sum=0;
- printf("Enter any intiger number:");
- scanf("%d",&n);
- for(i=0; i<=n; i+=2)
- sum=sum+i;
- printf("sum of all even numbers = %d\n",sum);
- return 0;
- }
Add Comment
Please, Sign In to add comment