Sail E0 Webinar

MCQs

Total Questions : 147 | Page 2 of 15 pages
Question 11. In CPP, the size of the character array should be one larger than the number of characters in the string.
  1.    True
  2.    False
 Discuss Question
Answer: Option A. -> True
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 12. An exception is thrown using _____________ keyword in CPP.
  1.    throws
  2.    throw
  3.    threw
  4.    Thrown
 Discuss Question
Answer: Option B. -> throw
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 13. Static variable in a class is initialized when _____ .
  1.    every object of the class is created.
  2.    last object of the class is created.
  3.    first object of the class is created.
  4.    No need to initialize static variable.
 Discuss Question
Answer: Option C. -> first object of the class is created.
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 14. Is it mandatory to invoke/call a constructor for creating an object?
  1.    Yes
  2.    No
 Discuss Question
Answer: Option A. -> Yes
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 15. Members of the class can be declared with auto, extern or register storage classes.
  1.    True
  2.    False
 Discuss Question
Answer: Option B. -> False
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 16. Which of the followings is/are not a manipulator/s ? 1. flush 2. base 3. ends 4. oct 5. bin 6. skipws
  1.    Only 1, 6
  2.    Only 1,4,6
  3.    Only 1,3,6
  4.    Only 2,5
 Discuss Question
Answer: Option D. -> Only 2,5
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 17. Which of the following is the perfect set of operators that can’t be overloaded in CPP ?
  1.    +=, ?, :: , >>
  2.    >>,
  3.    :: , . , .* , ?:
  4.    :: , ->, * , new, delete
 Discuss Question
Answer: Option C. -> :: , . , .* , ?:
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 18. To perform File I/O operations, we must use _____________ header file.
  1.    < ifstream>
  2.    < ofstream>
  3.    < fstream>
  4.    Any of these
 Discuss Question
Answer: Option C. -> < fstream>
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 19. If default constructor is not defined, then how the objects of the class will be created?
  1.    The compiler will generate error
  2.    Error will occur at run-time.
  3.    Compiler provides its default constructor to build the object.
  4.    None of these
 Discuss Question
Answer: Option C. -> Compiler provides its default constructor to build the object.
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!
Question 20. Which of the following is/are valid ways to allocate memory for an integer by dynamic memory allocation in CPP?
  1.    int *p = new int(100);
  2.    int *p; p = new int; *p = 100;
  3.    int *p = NULL; p = new int; *p=100;
  4.    Only 1,2
  5.    All of these
 Discuss Question
Answer: Option E. -> All of these
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Latest Videos

Latest Test Papers