Monday, April 1, 2013

C++ program to find HCF and LCM of two numbers

3:41 AM


Write a c++ program to find LCM of two numbers




# include <iostream>
# include <string >
using namespace std;
int main()
{
int a,b,c;
cout<< "Enter two nos :"<<endl;
cout<<endl;
cout<< "Enter first no. : ";
cin>>a;
cout<< "Enter sec. no. : ";
cin>>b;
c=a*b;
while(a!=b)
{
if(a>b)
a=a-b;
else
b=b-a;
}
cout<< "HCF = " << a<<endl;
cout<< "LCM = " << c/a<<endl;
return 0;
}


---------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------













---------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------

---------------------------------------------------
Write a c++ program to find LCM of two numbers 
I want a C++ program to find LCM and HCF of two
Find hcf and lcm using recursive technique
How To write a c program to calculate the lcm and hcf
LCM And HCF C++.Program to find HCF and LCM

Written by

We are one of the initiators of the development of information technology in understanding the need for a solution that is familiar and close to us.

0 comments:

Post a Comment

 

© 2013 Klick Dev. All rights resevered.

Back To Top