Examveda

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void copy (int& a, int& b, int& c)
{
    a *= 2;
    b *= 2;
    c *= 2;
}
int main ()
{
    int x = 1, y = 3, z = 7;
    copy (x, y, z);
    cout << "x =" << x << ", y =" << y << ", z =" << z;
    return 0;
}

A. 2 5 10

B. 2 4 5

C. 2 6 14

D. 2 4 9

Answer: Option C


Join The Discussion

Related Questions on Functions and Procedures in C plus plus