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