Function Call

Q.

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    void duplicate (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.
        duplicate (x, y, z);
13.
        cout << x << y << z;
14.
        return 0;
15.
    }
)
A. 1468
B. 2812
C. 2614
D. none of the mentioned

Answer : Option C

Explanation :

:We are passing the values by reference and modified the data on the function block.
Output:
$ g++ call1.cpp
$ a.out
2614