-
-
Save programmingfaster0226/faf22b25b7192eaf7e37dbe0897779a1 to your computer and use it in GitHub Desktop.
i dont
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int main() | |
{ | |
int a,b,i,sum=0; | |
printf("enter two numbers:"); | |
scanf("%d%d",&a,&b); | |
if(a>b) | |
{ | |
for (i=b; i<=a;i++) | |
{ if(i%2==0) | |
{ sum=sum+i;} | |
} | |
} | |
else | |
{ | |
for(i=a;i<=b;i++) | |
{ if(i%2==0) | |
{ sum=sum+i;} | |
} | |
} | |
printf("\n%d",sum); | |
getch(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment