Sail E0 Webinar

MCQs

Total Questions : 38 | Page 3 of 4 pages
Question 21. Which header file should you include if you are to develop a function that can accept variable number of arguments?
  1.    varag.h
  2.    stdlib.h
  3.    stdio.h
  4.    stdarg.h
 Discuss Question
Answer: Option D. -> stdarg.h


stdarg.h


Question 22. What is the maximum number of arguments or parameters that can be present in one function call?
  1.    64
  2.    256
  3.    255
  4.    16
 Discuss Question
Answer: Option B. -> 256


256


Question 23. What will initialize the list of arguments in stdarg.h header file?
  1.    va_list
  2.    va_start
  3.    va_arg
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> va_start


va_start


Question 24. Which is used to keep the call by reference value as intact?
  1.    static
  2.    const
  3.    absolute
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> const


Because const will not change the value of the variables during the execution.


Question 25. What will happen when we use void in argument passing?
  1.    It will not return value to its caller
  2.    It will return value to its caller
  3.    both a & b are correct
  4.    none of the mentioned
 Discuss Question
Answer: Option A. -> It will not return value to its caller


As void is not having any return value, it will not return the value to the caller.


Question 26. What will you use if you are not intended to get a return value?
  1.    static
  2.    const
  3.    volatile
  4.    void
 Discuss Question
Answer: Option D. -> void


Void is used to not to return anything.


Question 27. By default how the value are passed in c++?
  1.    call by value
  2.    call by reference
  3.    call by pointer
  4.    none of the mentioned
 Discuss Question
Answer: Option A. -> call by value


call by value


Question 28. How many types of returning values are present in c++?
  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer: Option C. -> 3


The three types of returning values are return by value, return by reference and return by address.


Question 29. What are the advantages of passing arguments by reference?
  1.    Changes to parameter values within the function also affect the original arguments.
  2.    There is need to copy parameter values (i.e. less memory used)
  3.    There is no need to call constructors for parameters (i.e. faster)
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


All of the mentioned


Question 30. What we will not do with function pointers?
  1.    allocation of memory
  2.    de-allocation of memory
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer: Option C. -> both a & b


As it is used to execute a block of code, So we will not allocate or deallocate memory.


Latest Videos

Latest Test Papers