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

Explain what is OOPS and its concepts?

784


how to check single or double byte in struts

1767


I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution

2412


Explain polymorphism. Provide an example.

780


Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.

1728






what is adodb??y it is used for connection of V.B and access??what is ado?dao?

1954


what is woransient key word? how it is used in java

2018


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

2546


what is the difference between an OS(operating system) and Framework?

1717


what are the differences between CONS, LIST, and APPEND

4976


Give examples of macro quoting function?

1730


10.Define filters,binary to hexadecimal,hexadecimal to decimal?

1698


what is integration testing in real time applications?

2065


Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number

910


What is BASIS

1878