C++ Programming Fundamentals

Comprehensive quiz covering C++ programming basics including OOP concepts, data structures, operators, stream I/O, and standard library functions

25 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following data types is a collection of different data types referenced under one name?

  1. Enumeration
  2. Union
  3. Structure
  4. None of these
Question 2 Multiple Choice (Single Answer)

Which of the following is also called 'manipulator' in C++?

  1. endl
  2. const
  3. malloc()
  4. none of these
Question 3 Multiple Choice (Single Answer)

Which of the following is the exit controlled statement in C++?

  1. For loop
  2. Do-while loop
  3. While loop
  4. None of these
Question 4 Multiple Choice (Single Answer)

Which of the following stream classes supports output functions: put() and write()?

  1. istream
  2. ostream
  3. streambuf
  4. none of these
Question 5 Multiple Choice (Single Answer)

Which of the following container classes allows the random access iteration permitting direct access to any element?

  1. Deque
  2. List
  3. Set
  4. None of these
Question 6 Multiple Choice (Single Answer)

Which of the following members of a class can neither be inherited in public mode nor in private mode?

  1. Protected
  2. Public
  3. Private
  4. None of these
Question 7 Multiple Choice (Single Answer)

Which of the following methods is used to achieve run-time polymorphism in C++?

  1. Function overloading
  2. Virtual function
  3. Operator overloading
  4. None of these
Question 8 Multiple Choice (Single Answer)

Which of the following functions of vector class gives current capacity of the vector?

  1. begin()
  2. clear()
  3. capacity()
  4. none of these
Question 9 Multiple Choice (Single Answer)

Which of the following operators in C++ cannot be overloaded?

  1. '<'
  2. '?:'
  3. '>'
  4. None of these
Question 10 Multiple Choice (Single Answer)

Which of the following functions is used to perform operator overloading in C++?

  1. Inline function
  2. Operator function
  3. Virtual function
  4. None of these
Question 11 Multiple Choice (Single Answer)

Which of the following properties of C++ bounds functions to the code to be executed at compile time?

  1. Dynamic binding
  2. Late binding
  3. Static binding
  4. None of these
Question 12 Multiple Choice (Single Answer)

Which of the following methods is used to give a new name to an existing data type in C++?

  1. typeid
  2. typedef
  3. typename
  4. none of these
Question 13 Multiple Choice (Single Answer)

Which of the following translates the software requirements into specifications for objects, and derives class hierarchies from which the objects can be created?

  1. Object oriented design
  2. Object oriented analysis
  3. Object oriented programming
  4. None of these
Question 14 Multiple Choice (Single Answer)

Which of the following menus in visual C++ compiles the source code in the active window and builds an executable file?

  1. View
  2. Build
  3. Tools
  4. Edit
Question 15 Multiple Choice (Single Answer)

Which of the following storage class specifiers informs the compiler that the variable so declared is defined in another source file?

  1. Auto
  2. Enumeration
  3. Extern
  4. None of these
Question 16 Multiple Choice (Single Answer)

Which of the following properties of C++ refers to putting together essential features without including background details?

  1. Inheritance
  2. Polymorphism
  3. Data abstraction
  4. None of these
Question 17 Multiple Choice (Single Answer)

Which of the following functions is used in C++ for the automatic initialization of class objects?

  1. Destructor
  2. Virtual function
  3. Constructor
  4. None of these
Question 18 Multiple Choice (Single Answer)

Which of the following operators has the highest precedence among other operators supported by C++?

  1. &&(logical AND)
  2. +(unary plus)
  3. ==(equal to )
  4. None of these
Question 19 Multiple Choice (Single Answer)

Which of the following mathematical functions returns tangent of the arguement in radians?

  1. tanh()
  2. sin()
  3. tan()
  4. none of these
Question 20 Multiple Choice (Single Answer)

Which of the following forms of inheritance occurs when the properties of one class are inherited by more than one class, forming a hierarchy of class?

  1. Multilevel inheritance
  2. Multiple inheritance
  3. Hierarchical inheritance
  4. None of these
Question 21 Multiple Choice (Single Answer)

We can create infinite loop in C++ by omitting the ______________ expression.

  1. initialization
  2. test
  3. update
  4. none of these
Question 22 Multiple Choice (Single Answer)

Which of the following error handling functions returns true when an input or output operation has failed?

  1. eof()
  2. fail()
  3. bad()
  4. none of these
Question 23 Multiple Choice (Single Answer)

Which of the following library functions is used in C++ to break out of the program, abandoning the rest of the execution of the program?

  1. break
  2. exit()
  3. go to
  4. none of these
Question 24 Multiple Choice (Single Answer)

Which of the following header files provides a set of manipulator functions to manipulate output formats?

  1. iostream.h
  2. iomanip.h
  3. conio.h
  4. string.h
Question 25 Multiple Choice (Single Answer)

Which of the following 'ios format functions' specifies format flags that can control the form of output display?

  1. width()
  2. precision()
  3. setf()
  4. none of these