CS201P Lab 12 Quiz by Danish Hanif
- Type
- Quiz
- Course
- CS201P Introduction to Programming (Practical)
- Size
- PDF 306 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extension for 30 a day.
Preview text
Text from pages 1, 2 of 2. Download the file for all 2 pages.
Q1. In C/C++ language, memory at runtime is allocated from _______.
Answer: c) Free store (heap)
Q2. Where can we declare a friend function in the class?
Answer: b) Anywhere
Q3. Which one is the correct syntax to declare the friend function?
Answer: b) friend return_type friend_function_name(int, char);
Q4. Data encapsulation can be achieved through ________.
Answer: c) Classes
Q5. In the following code, what will be the output of i?
```cpp #include<iostream> using namespace std; main(){ int i; int &j = i; i = 123; cout<< "\n The value of i =" << i;
a) 123 b) 012345 c) xX012345 d) 321
Answer: a) 123
Related CS201P files
All CS201P files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.