Skip to content

Instantly share code, notes, and snippets.

@programmingfaster0226
Created January 18, 2018 18:05
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/fb8d49dc4fbc9434b6b624b2787117fc to your computer and use it in GitHub Desktop.
Save programmingfaster0226/fb8d49dc4fbc9434b6b624b2787117fc to your computer and use it in GitHub Desktop.
/*Program to input two integer numbers and display the sum of even numbers between these two input numbers*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,x,y,t,hcf,lcm;
printf("enter two integer \n");
scanf("%d%d",&x,&y);
a=x;
b=y;
while (b!=0)
{ t=b;
b=a%b;
a=t;
}
hcf=a;
lcm=(x*y)/hcf;
printf("GCD=%d,and LCM=%d",hcf,lcm);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment