Compiler Design

1:

Assume that X and Y are non zero positive integers. What does the following Pascal program segment   do?

                                     while X  <  >  Y   do
                                      if     X  >  Y       then
                                      X :  =  X - Y
                                      else                    
                                      Y : = Y - X ;
                                      write (X);

A.

Computes LCM of two numbers

B.

Divides larger number by the smaller number

C.

Computes GCD of two numbers

D.

None of these

 

Answer : C

Explanation :

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.