What will be the output of the following C++ code? [code] #include <iostream> using namespace std; void Sum(int a, int b, int

Đức Lưu

New member
What will be the output of the following C++ code?
Code:
    #include <iostream>
    using namespace std;
    void Sum(int a, int b, int & c)
    {
        a = b + c;
        b = a + c;
        c = a + b;
    }
    int main()
    {
        int x = 2, y =3;
        Sum(x, y, y);
        cout << x << " " << y;
        return 0;
    }
A. 2 3
B. 6 9
C. 2 15
D. compile time error
 

Tìm kiếm

Back
Top