Home / C++ Programming / Functions - C++ :: General Questions

C++ Programming :: Functions - C++

  1. Where the default value of parameter have to be specified?

  2. A.
    Function call
    B.
    Function definition
    C.
    Function prototype
    D.
    Both B or C

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which of the following statement is correct?

  4. A.
    The default value for an argument cannot be function call.
    B.
    C++ allows the redefinition of a default parameter.
    C.
    Both A and B.
    D.
    C++ does not allow the redefinition of a default parameter.

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Which of the following statement is correct?

  6. A.
    Only one parameter of a function can be a default parameter.
    B.
    Minimum one parameter of a function must be a default parameter.
    C.
    All the parameters of a function can be default parameters.
    D.
    No parameter of a function can be default.

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of the following statement is incorrect?

  8. A.
    A default argument is checked for type at the time of declaration and evaluated at the time of call.
    B.
    We can provide a default value to a particular argument in the middle of an argument list.
    C.
    We cannot provide a default value to a particular argument in the middle of an argument list.
    D.
    Default arguments are useful in situations where some arguments always have the same value.

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which of the following statement is correct?

  10. A.
    Overloaded functions can accept same number of arguments.
    B.
    Overloaded functions always return value of same data type.
    C.
    Overloaded functions can accept only same number and same type of arguments.
    D.
    Overloaded functions can accept only different number and different type of arguments.

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Which of the following function / types of function cannot have default parameters?

  12. A.
    Member function of class
    B.
    main()
    C.
    Member function of structure
    D.
    Both B and C

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Which of the following statement is correct?

  14. A.
    The order of the default argument will be right to left.
    B.
    The order of the default argument will be left to right.
    C.
    The order of the default argument will be alternate.
    D.
    The order of the default argument will be random.

    View Answer

    Workspace

    Discuss Discuss in Forum