1.

What is the output of this program?
#include 
using namespace std;
int GCD(int p, int q)
{
int temp;
while (q != 0)
{
temp = p % q;
p = q;
q = temp;
}
return(p);
}
int main ()
{
int m = 10, n = 120;
cout << GCD(m, n);
return(0);
}

A. 10
B. 120
C. Compilation Error
D. Runtime Error
E. None of these
Answer» B. 120


Discussion

No Comment Found

Related MCQs