Question
1.
#include
2.
using namespace std;
3.
void Sum(int a, int b, int & c)
4.
{
5.
a = b + c;
6.
b = a + c;
7.
c = a + b;
8.
}
9.
int main()
10.
{
11.
int x = 2, y =3;
12.
Sum(x, y, y);
13.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
void Sum(int a, int b, int & c)
4.
{
5.
a = b + c;
6.
b = a + c;
7.
c = a + b;
8.
}
9.
int main()
10.
{
11.
int x = 2, y =3;
12.
Sum(x, y, y);
13.
cout
Answer: Option C
Was this answer helpful ?
We have passed three values and it will manipulate according to the given condition and yield
the result as 2 15
Output:
$ g++ arg.cpp
$ a.out
2 15
Was this answer helpful ?
More Questions on This Topic :
Question 6.
By default how the value are passed in c++?
....
Submit Solution