CPP Important Questions and RealLife Problems Watermark
CPP Important Questions and RealLife Problems Watermark
2 Marks Questions
5. Write a small C++ snippet to demonstrate the use of cin and cout.
9. What does the following code do? int arr[5] = {1, 2, 3, 4, 5}; cout << arr[2];
5 Marks Questions
2. Write a C++ program to define a class Student with data members name and rollNo, and a
6. Write a structure and function to insert a node at the beginning of a singly linked list.
7. Write a C++ program to perform push and pop operations on a stack using an array.
10 Marks Questions
1. Write a complete C++ program to demonstrate:
- Class creation
- Access specifiers
- Inline function
2. Write a C++ program to demonstrate single and multiple inheritance with appropriate member
functions.
3. Write a program to implement binary search in a sorted array and return position if found or -1 if
not.
4. Implement a stack using a linked list with push and pop operations in C++.
5. Implement a queue (both linear and circular) using arrays with insertion and deletion functions.
6. Write a program to create a singly linked list, insert a node at the end, and delete a node by
value.
8. Write a complete sorting program using insertion sort and explain its time complexity.
9. Write a program to declare and initialize a 2D array and perform row-wise and column-wise
summation.
10. Create a menu-driven program in C++ for stack operations using array (Push, Pop, Display).