Skip to content

Instantly share code, notes, and snippets.

@programmingfaster0226
Created January 18, 2018 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save programmingfaster0226/faf22b25b7192eaf7e37dbe0897779a1 to your computer and use it in GitHub Desktop.
Save programmingfaster0226/faf22b25b7192eaf7e37dbe0897779a1 to your computer and use it in GitHub Desktop.
i dont
#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