Assume A and B are non-zero positive integers. The following code segment:…
ISRO Scientist/Engineer SC 2018
Assume A and B are non-zero positive integers. The following code segment:
while ( A != B){
if ( A > B ) A - = B ;
else B - = A ;
}
cout << A; // printing the value of A
- A.
Computes the LCM of two numbers
- B.
Divides the larger number by the smaller number
- C.
Computes the GCD of two numbers
- D.
Finds the smaller of two numbers
Attempted by 1093 students.
Sign up free to check your answer
Sign up freeLoading lesson…

