Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

I am work in it aompenei

1388


What is web.configuration? how is it work? & wht is use this?

1823


What is the Difference between in memory database and physical database

2527


suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?

2017


Have you used callsymputx? what points need to be kept in mind when using it?

1925


what is class module in vb6? what it's use? with example..

2400


what is the purpose of checked Menu options

2398


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

1835


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

1821


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.

926


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.)

1020


How to know we are in home page of a web application using QTP

2381


any drawback are there in mantis?

2087


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)

1125


what is the basic and unique feature of dotnet

2177