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
I am work in it aompenei
What is web.configuration? how is it work? & wht is use this?
What is the Difference between in memory database and physical database
suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?
Have you used callsymputx? what points need to be kept in mind when using it?
what is class module in vb6? what it's use? with example..
what is the purpose of checked Menu options
When we delete logfiles such as screenshots how does it affect the ldf file? Ive seen huge change while adding screenshots in the ldf file but a very minor one deleting them.Please Explain
Busy waiting is a method whereas a taskwaits for a given event by continiously checking for an event to occur. What is the main problem with this approach
Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can?t pass the value k to any function also.
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.)
How to know we are in home page of a web application using QTP
any drawback are there in mantis?
Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
what is the basic and unique feature of dotnet