-
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);
}
-
- 10
- 120
- Compilation Error
- Runtime Error
- None of these
Correct Option: A
In this program, we are finding the gcd of the number.