Write a Pseudo Code to fins the LCM of two given numbers

Answer Posted / zain

#include<iostream>
using namespace std;
int LCM(int a,int b);
int main()
{
int a,b;
cout<<" ENTER TWO NUMBER : ";
cin>>a>>b;
cout<<"\n\n LCM : "<<LCM(a,b);
system("pause");
return 0;
}
int LCM(int a,int b)
{
int n;
for(n=1;;n++)
{
if(n%a == 0 && n%b == 0)
return n;
}
}

Is This Answer Correct ?    49 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is delimiter in sas ?

1547


Difference between HTML and DHTML?

1670


can we use commit,rollback in triggers and how?

1508


hi, all this is shoba m.c.a . i have learned abap but no oppurtunities right now as fresher , right now i want to learn any course on demand any one pls suggest me good course and institute in hyderabad

1398


What is the difference beween joblib and steplib statements

1787






what is delegate and delegation model give the real live example on delegate model

2823


will it allow to add same value in HashMap class.

1667


any drawback are there in mantis?

1648


When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code)

729


when a query is made on Logical file in DB2/400, will the records satisfying select/omit criterion be fetched from all members of physical file or only the member with same name as physical file?

1722


when will triggars the at new event in abap and web dybn pro?

1494


qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again

2356


in network security,how we identified threat?some one say we found threat according to it's signature,but how we get signature or pattern of the virus?

1528


I want to insert date in the form of yyyy-mm-dd... if any changes happen while inserting date format want to show error meg...any one can solve this..??

1663


1.how to deploy the Maven application in weblogic server? 2.In Real time projects all classes are singleton or some classes only singleton explain? 3.what are the major uses of the designpatterns? 4.explain restful &Soap based services explain?

1656