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 5.
What is the use of the indentation in c++?
....
Question 8.
What is a comment in c++?
....
Question 9.
What type of comments does c++ support?
....
Question 10.
How many types of comments are there in c++?
....
Submit Solution