Skip to content
VUBuddy

CS201P Lab 12 Quiz by Danish Hanif

Introduction to Programming (Practical) PDF 306 KBUpdated 23 Oct 2026
Quiz CS201P Lab 12 Quiz by Danish Hanif PDF 306 KB
vubuddy.com
Type
Quiz
Course
CS201P Introduction to Programming (Practical)
Size
PDF 306 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 306 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2 of 2. Download the file for all 2 pages.

Paid Services Available 10/10 Marks Guarantee · CS201p Lab #12 Quiz · File · 1/3/2024 10:54:42 PM

Q1. In C/C++ language, memory at runtime is allocated from _______.

  1. ROM
  2. Stack
  3. Free store (heap)
  4. Hard disk

Answer: c) Free store (heap)

Q2. Where can we declare a friend function in the class?

  1. Void
  2. Anywhere
  3. Main()
  4. Nowhere

Answer: b) Anywhere

Q3. Which one is the correct syntax to declare the friend function?

  1. FRIEND friend_function_name(int, char);
  2. friend return_type friend_function_name(int, char);
  3. Friend return_type (int, char);
  4. FRIEND return_type friend_function_name(int, char);

Answer: b) friend return_type friend_function_name(int, char);

Q4. Data encapsulation can be achieved through ________.

  1. Structures
  2. Pointers
  3. Classes
  4. Arrays

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

All CS201P files →
CS201P Introduction to Programming (Practical) All CS201P handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.