Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
void copy (int& a, int& b, int& c)
4.
{
5.
a *= 2;
6.
b *= 2;
7.
c *= 2;
8.
}
9.
int main ()
10.
{
11.
int x = 1, y = 3, z = 7;
12.
copy (x, y, z);
13.
cout
Options:
A .  2 5 10
B .  2 4 5
C .  2 6 14
D .  none of the mentioned
Answer: Option C

Because we multiplied the values by 2 in the copy function.
Output:
$ g++ arg6.cpp
$ a.out
x = 2,y = 6,z = 14



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers