Part A – Very Short Answer Questions (1 mark each)
(Answer any 5 questions)
1. What is the use of #include<iostream> in a C++ program?
2. Which header file is required for cout and cin?
3. What is the use of using namespace std;?
4. Write the syntax of an if statement in C++.
5. What will be the output of the following code?
cout << (5 > 3);
6. Define a variable in C++.
7. Name two conditional control statements in C++.
---
Part B – Short Answer Questions (2 marks each)
(Answer any 5 questions)
8. Write a C++ program to check whether a number is even or odd.
9. Differentiate between = and == operators with examples.
10. Explain the structure of a simple C++ program.
11. What are keywords? Give two examples.
12. Write a C++ program to find the largest of two numbers using if-else.
13. Explain cin and cout with syntax and example.
---
Part C – Short Essay Questions (3 marks each)
(Answer any 3 questions)
14. Explain the different types of data types available in C++.
15. Write a C++ program to check whether a number is positive, negative, or zero.
16. What are relational operators? Give examples with output.
17. Explain the working of the nested if statement with an example.
---
Part D – Essay Questions (5 marks each)
(Answer any 2 questions)
18. Explain the features of Object-Oriented Programming.
19. Write a C++ program to find the largest of three numbers using conditional statements.
20. Explain the difference between if, if-else, and if-else-if ladder with suitable examples