Thursday, July 29, 2010

LCM and HCM of two numbers


LCM and HCM of two numbers

/* C++ program to calculate LCM and HCM of two numbers */
#include< stdio.h>
#include< conio.h>
void main()
{
int a,b,c;
cout< < "Enter two nos : ;
cin>>a>>b;
c=a*b;
while(a!=b)
{
if(a>b)
a=a-b;
else
b=b-a;
}
cout< < "HCM \t= " < < a;
cout< < "LCM \t= " < < c/a;
getch();
}


--
http://www.venkatmails.blogspot.com/

Venkat Mails, Fun , Cool pictures, Fun messages, Sardar Jokes, Quotations Moral stories Fun stories

http://www.venkatmails.blogspot.com/

No comments:

Post a Comment