Overloading


  1. What are the advantages of passing arguments by reference?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    *There is no need to call constructors for parameters (i.e. faster).
    *Changes to parameter values within the function also affect the original arguments.
    *There is need to copy parameter values (i.e. less memory used).


  1. When our function doesn’t need to return anything means what will we use/send as parameter in function?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    blank space



  1. What will happen while using pass by reference











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In pass by reference, we can use the function to access the variable and it can modify it. Therefore we are using pass by reference.


  1. Overloaded functions are











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Two or more functions with the same name but different number of parameters or type



  1. What is the output of the following program?
    #include 
    using namespace std;
    int calculate(int p, int q)
    {
    return (p * q);
    }
    float calculate (float p, float q)
    {
    return (p / q);
    }
    int main()
    {
    int n = 10, m = 3;
    float r = 30.0, s = 10.0;
    cout << calculate(n, m) <<" ";
    cout << calculate (r, s);
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In this program, we are divide and multiply the values.