Skip to content

Instantly share code, notes, and snippets.

@programmingfaster0226

programmingfaster0226/hcflcm Secret

Created Jan 18, 2018
Embed
What would you like to do?
/*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
You can’t perform that action at this time.