Quiz: Functions

To View Tricks: Login Required

Number of Questions: 25

Question: 1 -

Which of the following statement will be correct if the function has three arguments passed to it?

Options:
  1. The trailing argument will be the default argument.

  2. The first argument will be the default argument.

  3. All the argument will be the default argument.

  4. The middle argument will be the default argument.

  5. Answer:

    The trailing argument will be the default argument.

    Solution not available.

Question: 2 -

Which of the following statement is correct?

A. Overloaded functions can have at most one default argument.
B. An overloaded function cannot have default argument.
C. All arguments of an overloaded function can be default.
D. A function if overloaded more than once cannot have default argument.

Options:
  1. A

  2. B

  3. D

  4. C

  5. Answer:

    C

    Solution not available.

Question: 3 -

Which of the following function prototype is perfectly acceptable?

Options:
  1. int Function(int Tmp = Show());

  2. float Function(int Tmp = Show(int, float));

  3. float = Show(int, float) Function(Tmp);

  4. Both A and B.

  5. Answer:

    int Function(int Tmp = Show());

    Solution not available.

Question: 4 -

Where does the execution of the program starts?

Options:
  1. else function

  2. user-defined function

  3. main function

  4. void function

  5. Answer:

    main function

    Solution:

    Normally the execution of the program in c++ starts from main only.


Question: 5 -

Which of the following statement is correct?

Options:
  1. We cannot use the constant while defining the function.

  2. C++ enables to define functions that take constants as an argument.

  3. Both A and B.

  4. We cannot change the argument of the function that that are declared as constant.

  5. Answer:

    Both A and B.

    Solution not available.