Sail E0 Webinar

MCQs

Total Questions : 38 | Page 2 of 4 pages
Question 11. Where does the return statement returns the execution of the program?
  1.    main function
  2.    caller function
  3.    same function
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> caller function


caller function


Question 12. What will happen while using pass by reference
  1.    The values of those variables are passed to the function so that it can manipulate them
  2.    The location of variable in memory is passed to the function so that it can use the same memory area for its processing
  3.    The function declaration should contain ampersand (& in its type declaration)
  4.    All of the mentioned
 Discuss Question
Answer: Option B. -> The location of variable in memory is passed to the function so that it can use the same memory area for its processing


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.


Question 13. When will we use the function overloading?
  1.    same function name but different number of arguments
  2.    different function name but same number of arguments
  3.    same function name but same number of arguments
  4.    different function name but different number of arguments
 Discuss Question
Answer: Option A. -> same function name but different number of arguments


In function overloading, we can use any number of arguments but same function name.


Question 14. Overloaded functions are
  1.    Very long functions that can hardly run
  2.    One function containing another one or more functions inside it.
  3.    Two or more functions with the same name but different number of parameters or type.
  4.    none of the mentioned
 Discuss Question
Answer: Option C. -> Two or more functions with the same name but different number of parameters or type.


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


Question 15. When our function doesn't need to return anything means what we will as parameter in function?
  1.    void
  2.    blank space
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> blank space


blank space


Question 16. What is the default return type of a function ?
  1.    int
  2.    void
  3.    float
  4.    char
 Discuss Question
Answer: Option B. -> void


void


Question 17. What we can't place followed by the non-default arguments?
  1.    trailing arguments
  2.    default arguments
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> default arguments


default arguments


Question 18. How can you access the arguments that are manipulated in the function?
  1.    va_list
  2.    arg_list
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer: Option A. -> va_list


va_list


Question 19. Which header file is used to pass unknown number of arguments to function?
  1.    stdlib.h
  2.    string.h
  3.    stdarg.h
  4.    none of the mentioned
 Discuss Question
Answer: Option C. -> stdarg.h


Because the cstdarg defines this header file to process the unknown number of arguments.


Question 20. If we start our function call with default arguments means, what will be proceeding arguments?
  1.    user argument
  2.    empty arguments
  3.    default arguments
  4.    none of the mentioned
 Discuss Question
Answer: Option C. -> default arguments


As a rule, the default argument must be followed by default arguments only.


Latest Videos

Latest Test Papers