Programming Languages MCQ Questions and Answers

Inheritance in Object Oriented Programming (OOPs) MCQ Questions and Answers

Q1. In OOP, “inheritance” primarily promotes which key concept? A) Encapsulation B) Code reusability C) Data hiding D) Overloading Answer: B) Code reusability Q2. The class that is inherited from another class is called: A) Parent class B) Base class C) Derived class D) Subclass Answer: B) Base class Q3. The class that inherits another

Memory Allocation in C Programming MCQ Questions and Answers

Q1. Which memory allocation type occurs automatically when a function is called? A) Static memory allocation B) Automatic memory allocation C) Dynamic memory allocation D) Register memory allocation Answer: B) Automatic memory allocation Q2. Which of the following is responsible for allocating memory at compile time? A) Static memory allocation B) Dynamic memory allocation C)