Question from the Algorithmics - Fundamentals test

Archived

The following recursive algorithm is used to calculate the Greatest Common Divisor of two numbers a and b (0<=b<=a and a=qb +r):

function calcPGCD(a, b)
{
    If b = 0 
    {
        display a;
    }  
    Else 
   {
            calcPGCD (b, a modulo b);
            display ''calcPGCD('' +a+ '','' +b+'')'';
   } 
 }

What does this code display when a is 21 and b is 15?

Author: KahinaStatus: Archived(New question!)Question passed 2 times
0
Community EvaluationsNo one has reviewed this question yet, be the first!