Skip to content
VUBuddy

CS201 Final Term Past Paper

Introduction to Programming PDF 230 KBUpdated 23 Oct 2026
Final term past paper CS201 Final Term Past Paper PDF 230 KB
vubuddy.com
Type
Final term past paper
Course
CS201 Introduction to Programming
Size
PDF 230 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 230 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.

Date: 20/Aug/2016

CS 201 Final Paper

Q1. What is returned by new operator?

Q2. Which bitwise operator returns true if both bits are different and returns false if both bit are the same?

Q3. When does an get destroyed?

Q4. Suppose an object of class A is declared as data member of class B:

  1. The constructor of which class will be called first?
  2. The destructor of which class will be called first?

Q5. Assume that you write a program to read the data from a text file. You have two options to do it, either read the data character by character or reading multiple lines of data at a time. Which option do you think is more better and why?

Q6. What do you understand by keyword ‘this’ and what are the uses of ‘this’ pointer?

The keyword of ‘this’ we can using the pointer of the object or class. There was trement of this operator easy can understand of keyword?

  1. Write a program which defines two variables var1 and var2 of type int and stores two different values in these variables. Print the values of these variable in three different number systems using manipulators dec, hex, oct.
  2. Write a program in C++, which will prompt the user to input 8 values for a 2x4 matrix. The display those values in 2x4 matrix format.

/* Program Output will look like this: Enter eight values for a 2x4 Matrix:

Matrix entered in its original matrix format:

  1. Identify the errors in the given code and correct them.

for ( int i==0; j<numRows; i--)

for (int j=0;) j<numCols; j--)

elements [I, j] == m.elements[i][j];

Q10. What will be the output of the following code snipper?

int x = 10; int &y=x, y+=5, cout << x.

Q11. Write down the output of the code given below?

#include <iostream> using name space std; union Num {iInt ValueI, float ValueF, double ValueD, char ValueC,

void main()

// Optional union keyword // ValueI = 100 Num TestVal = (100), count <<”\nInteger=”<<testVal ValueI<<endl; TestVal ValueF =2.123 count <<”Float=”<< TestVal ValueF<<endl; count <<”Uninitialzed double=”<< TestVal ValueD<<endl; cout<<”Some rubbish???”<<endl; TestVal ValueC=’U’, cout<<”Character=”<< TestVal ValueC<<endl;

  1. Following code segment contains errors. Give brief description of each error.

Class circle:

Private: double centerX, double center, double radius, Public: setCenter(double.double); setRadius(double);

-------------x------------------x--------------------------x------------------------x---------------------x---------------x-------------

All CS201 files →
CS201 Introduction to Programming All CS201 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.