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
Need guidewire related Documents(Interview Question/Tips/Best Practice/Dumps)
Please forward important interview and basic questions in VB6 on my email id: usneha_16@yahoo.co.in
I'm new to ABAP. What is Module pool in SAP?
Define distributed queries. can you explain me as soon as possible
how to stop execution of step 3 in a job mainframe
what is web service in java? have u use before.
they asked me about srs (software requirement specifcation)? how can i get anydocumentation about srs & other documnts infomation like bdd, in testing? its urgent?
can we allocate memory for interface? if no then why?
When will you use shell script/Perl ahead of C/C++?
public static void main(String args[]) describe it
what is the system development cycle
1. Consider the following input and generate the object code using single pass assembler. JOHN START 0 USING *,15 L 1,FIVE A 1,FOUR ST 1,TEMP FOUR DC F’4’ FIVE DC F’5’ TEMP DS ‘F END
how to convert infix expression to prefix expression?
i want to improve my english vocab for racking campus written exam plz tell me best book for prepration......
what is class module in vb6? what it's use? with example..