Home » C++ Programming » Operators » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    void Add(int p, int q, int & r)
    {
    p = q + r;
    p = q + r;
    r = p + q;
    }
    int main()
    {
    int n = 6, m =4;
    Add(n, m, m);
    cout << n << " " << m;
    return 0;
    }
    1. 6 12
    2. 6
    3. 12
    4. 6 4
    5. 12 6
Correct Option: A

We have passed three values and it will manipulate according to the given condition and yield the result as 6 12.



Your comments will be displayed only after manual approval.