Assume X and Y are non zero positive integers the following pascal program while x <> y do if x > y then x := x−y; else y:= y−x; Write (x);
A
Computer the LCM of two numbers
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Divide the larger number by the smaller number
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Computers the GCD of two numbers
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
Find the smaller of two number
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is B Computers the GCD of two numbers GCD (Greatest common integer) can in principle be computed by determining the prime factorizations of the two numbers and comparing factors.