Home » C++ Programming » Introduction » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    void copy (int& p, int& q, int& r)
    {
    p = p * 1;
    q = q * 2;
    r = r * 3;
    }
    int main ()
    {
    int m = 6, n = 3, o = 2;
    copy (m, n, o);
    cout << "M = " << m << ", N = " << n << ", O = " << o;
    return 0;
    }
    1. M = 6, N = 6, O = 6
    2. N = 6, O = 6, M = 6
    3. O = 6, M = 6
    4. Compilation Error
    5. None of these
Correct Option: A

Because we multiplied the values by 1,2 and 3 in the copy function.



Your comments will be displayed only after manual approval.