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

In OB52 , How to define two open posting period, Like only 5 and 8 posting should be open.. should not open 6 and 7..period..

989


in teradata level primary in table level allows duplicates why?

1643


In JCl , we have COND parameter.This holds comparison code and condition.It also has only and even parameters. ex: COND((4,GE),EVEN).what the comma mean here. is that 'and' or 'or'.

1810


how to remove header and footer in jcl using sort utility

5094


I am taking the bmc control m/enterprise manager 7.0 scheduling test and just wanted to see what kind of questions they would ask or if anyone has taken the test and how long it is for how many questions?

5661






how many types of bytes are there???

1979


Find out the list of authorization objects which contains activity as a field? Thanks in advance.

1757


What is autocall macro and how to create autocall macro? what is the use of it?

1490


Write a program to create a process in UNIX

2085


EXPLAIN UNARY OPEARATORS

1800


why we use mantis? what u mean mantis in IT trends? addvantages of mantis?

1738


what is the difference between SCAN AND CHECK,LOKUP AND XFOOT? where we can use thease opcodes? Can any body tell me real time senariao with example?

2086


Write a program to find factorial of a number using functions

1244


Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.

643


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

1385