Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void main()
- {
- int i,x,y,sum=0;
- printf("Enter first value: ");
- scanf("%d",&x);
- printf("Enter second value: ");
- scanf("%d",&y);
- for (i=x;i<=y;i++)
- {
- if(i%2==0)
- sum=sum+i;
- }
- printf("Sum is: %d",sum);
- }
Add Comment
Please, Sign In to add comment