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 are resources in case of Threads
if 3 duplicate records, by keeping one original and one duplicate record, and how to delete remaining 2 duplicates in sql server 2008
Write a shell program to test whether a given year is leap year or not ?
Need guidewire related Documents(Interview Question/Tips/Best Practice/Dumps)
a characteristic of a multiprogramming is? a.simultaneous exe of pgm instr 4m 2 appli b.concurrent processing of 2 r more prgms c.multiple cpu s d.all the abov
What is web.configuration? how is it work? & wht is use this?
Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad
I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution
kindly send interview materials
how do we provide security for web services
i am getting the error while compiling my cics program with including db2 dclgen member it is showing that ur dclgen member not including and all the host variables are undeclared
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?
Any real time example of O2C process from taking order till creating invoice.
design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.
Can anyone send me NIC question papers alongwith answers on nidhi1485@yahoo.co.in? Urgently needed.. Thanks in advance