Functions


  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    void duplicate (int& P, int& Q, int& R)
    {
    P *= 2;
    Q *= 2;
    R *= 2;
    }
    int main ()
    {
    int M = 2, N = 4, O = 6;
    duplicate (M, N, O);
    cout << M <<" "<< N <<" "<< O;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    We are passing the values by reference and modified the data on the function block.