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
what is the diff bw sql direct and jdbc update can't we do select and updating operation in sql direct
What binary value will be internally stored for NULL for the type S9(1) COMP 3 in mainframe
what is the diffrence between software and hardware language?
how to stop execution of step 3 in a job mainframe
How to use string functions in QTP?give some examples
How do you pass variables forwrd to future CECI sessions
Write a shell program where you enter a number which corresponds to K.M. Find out the corresponding values in m, cm, inches, and feet. Hints:- 1 k.m= 1000 m 1 m= 100 cm 1 inches= 2.54 cm. 1 feet= 12 inches
what is log files in qtp what is use
how to convert infix expression to prefix expression?
Hello...has anyone interviewed with Information Management Services(IMS)located in Silver Spring MD??If yes,what can you share about the programming test and the analytical test?
You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
What is Negative testing?
how to fin top two miximum values in sql? not 2nd both max value of 1st and 2nd both have to find out
1. How many jobs can we write in a single file? 2. How many maximum members can exist in a single partition data set(pds) in jcl?
what is difference between object oriented programming structure and object oriented programming system?