Q1. What is OOP?
Ans Object-Oriented Programming focuses on objects and classes rather than procedures.
Q2.What is a class?
Ans A class is a blueprint for creating objects.
Q3. What is an object?
Ans An object is an instance of a class.
Q4. What is encapsulation?
Ans Encapsulation is binding data and methods together in a single unit.
Q5.What is inheritance?
Ans Inheritance allows a class to acquire properties and behavior of another class.
Q6. What is polymorphism?
Ans The ability of functions or operators to behave differently based on context.
Q7. What is overloading?
Ans. Defining multiple functions with the same name but different parameters.
Q8. How is C related to C++?
Ans. C++ is an extension of C that adds object-oriented features.
Q9. What is the use of cout?
Ans cout is used for displaying output on the screen.
Q10 What is the use of cin?
Ans cin is used for taking input from the user.
Q11. What is a preprocessor directive?
Ans A statement that begins with # and is processed before compilation.
Q12. How are comments written in C++?
A: Using // for single line and /* ... */ for multi-line.
Q13. What does setw() manipulator do?
Ans It sets the width of the output field.
Q14 What are arithmetic operators?
A: Operators used for mathematical operations like +, -, *, /, %.
Comments
Post a Comment
Thank you for comment.