Question
1.
#include
2.
using namespace std;
3.
int gcd (int a, int b)
4.
{
5.
int temp;
6.
while (b != 0) {
7.
temp = a % b;
8.
a = b;
9.
b = temp;
10.
}
11.
return(a);
12.
}
13.
int main ()
14.
{
15.
int x = 15, y = 25;
16.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int gcd (int a, int b)
4.
{
5.
int temp;
6.
while (b != 0) {
7.
temp = a % b;
8.
a = b;
9.
b = temp;
10.
}
11.
return(a);
12.
}
13.
int main ()
14.
{
15.
int x = 15, y = 25;
16.
cout
Answer: Option D
Was this answer helpful ?
In this program, we are finding the gcd of the number.
Output:
$ g++ ret5.cpp
$ a.out
5
Was this answer helpful ?
More Questions on This Topic :
Question 1.
When will we use the function overloading?
....
Submit Solution