Write a Pseudo Code to fins the LCM of two given numbers
Answer Posted / sudhir
int gcd(int a, int b)
{
if (a==0 && b==0) return -1;
if (b==0) return a;
return gcd(b,a%b);
}
int lcm (int a, int b)
{
return (int) (a*b)/gcd(a,b);
}
| Is This Answer Correct ? | 22 Yes | 4 No |
Post New Answer View All Answers
what is the last ant version you worked?how to get it
Given an array of size n+1 which contains all the numbers from 1 to n.Find the number which is repeated in O(n) time.How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?
What is SOLID Principle in Programming Language?
How many forms can you create in a Visual Basic 6 Standard EXE project? Is there any limit on that?
ok how would i do the following extract from a file i have ssns = 267907230 which are in column 7 into a separate data set then create a 2nd job step to extract from the data set created the following "fund code" which is in column 31 and is 113 into yet another data set
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)
in IT trend mantis meant what? how to know mantis in IT trends? detail description about mantis?
in cobol,wat is the difference in using 'set index in occurs clause' ....and 'occurs depending-on clause'
When we use Windows authentication mode
What are events in smartforms?
could you please tell me how to draw the calibration curve for HPLC {the software which we are using}?
What is the difference beween joblib and steplib statements
what are resources in case of Threads
what is the meaning of without standing arrears?
Difference of Console, web & windows applications?