1. In a CRT display, the device used to accelerate and focus the electron beam is called the A) Control Grid B) Electron Gun C) Deflection Coil D) Phosphor Screen Answer: B 2. The persistence of a phosphor refers to A) The time taken for the phosphor to heat up B) The time taken for
1. In a multifile C++ program, the #include directive is used primarily to: A) Include only function definitions from another file B) Include declarations or prototypes from a header file C) Link multiple object files D) Execute code from another file Answer: B 2. In a multifile project, which file typically contains function implementations? A)
1. Which header file is used for file handling in C++? A) stdio.h B) cstdlib C) fstream D) iomanip Answer: C 2. Which class in C++ is used to write data to files? A) ifstream B) ofstream C) fstream D) ostream Answer: B 3. Which class in C++ is used to read data from files?
1. Which keyword in C++ is used to handle exceptions? A) error B) catch C) handle D) try Answer: D) try 2. What is the purpose of the catch block in C++? A) To raise an exception B) To declare exceptions C) To handle the exception thrown by try block D) To ignore the error
Q1. What is the correct syntax to declare a function template in C++? A) template function B) template C) template D) template (typename T) Answer: C Q2. In a function template, what does the keyword typename signify? A) Declares a function argument B) Declares a new class C) Specifies a placeholder for a data type
Q1. Which type of inheritance allows a class to inherit from more than one base class? A) Single Inheritance B) Multilevel Inheritance C) Multiple Inheritance D) Hierarchical Inheritance Answer: C Q2. When a derived class inherits from a single base class, it is known as: A) Single Inheritance B) Multiple Inheritance C) Multilevel Inheritance D)
1. Which of the following best defines function overloading in C++? A) Using one function name for functions in different classes B) Having functions with identical names and identical parameters C) Having multiple functions with the same name but different parameter lists D) Using functions with different return types Answer: C 2. Function overloading in
1. What is a constructor in C++? A) A function that handles file I/O B) A special member function used to initialize objects C) A function that deallocates memory D) A function template for operator overloading Answer: B) A special member function used to initialize objects 2. What is a destructor in C++? A) A
1. What is the default access specifier for members of a class in C++? A) public B) protected C) private D) internal Answer: C) private 2. Which of the following will be called first when an object is created? A) Destructor B) Member function C) Constructor D) Copy assignment operator Answer: C) Constructor 3. Which
1. Which keyword in C++ is used to declare a virtual function? A) static B) virtual C) abstract D) override Answer: B 2. Virtual functions are primarily used to achieve: A) Compile-time polymorphism B) Run-time polymorphism C) Function overloading D) Template specialization Answer: B 3. A virtual function must be declared inside a: A) Global