wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Assume X and Y are non zero positive integers the following pascal program while x <> y do
if x > y then
x := xy;
else
y:= yx;
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.
Example:- suppose take x=36 and y=60
36= 2*2*3*3
60= 2*2*3*5
GCD= Multiplication of common factors
2*2*3=12.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Singleton Set
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon