Skip to content
VUBuddy

CS201 Midterm Past Papers by Tariq

Introduction to Programming PDF 60 KBUpdated 23 Oct 2026
Midterm past paper CS201 Midterm Past Papers by Tariq PDF 60 KB
vubuddy.com
Type
Midterm past paper
Course
CS201 Introduction to Programming
Size
PDF 60 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 60 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, 3 of 5. Download the file for all 5 pages.

  1. Overflow condition occurs when we try to assign a value to a variable which is

Greater than its maximum size

Within its range Equal to its size Less than its maximum size

  1. The _break_______ statement interrupts the flow of control.

Switch/loop

continue goto break

Q3. Which of the following operators is used to access the value of variable pointed by a pointer?

* operator

-> operator && operator & operator

  1. Which of the following is not a reserve word for data types in standard C/C++? int

float

real

double

  1. To assigned a value to a character type variable, ________ are used around the value.

parenthesis ( )

single qoutes ' '

double qoutes " " curly braces { }

  1. When x = 7; then the expression x%= 2; will calculate the value of x as

Q7. What is the highest legal index for the following array?

int arr[4]

Q8. For which array, the size of the array should be one more than the number of elements in an array?

int double float

char

  1. In programming, comments are used to explain the functioning of the _______ . Debugger

Editor

Program

Linker

  1. Operating System is a type of a/an ___________.

application software

system software

computer language interpreter

  1. _________ are very good tools for code reuse.

operators loops

functions

variables

  1. Identify the correct option which is used for calling the function int square (int *).

square(int &num) ;

square(&num) ;

square(*num) ; square(num) ;

  1. The _________ statement allows us to select from multiple choices based on a set of fixed values for a given expression.

switch

break continue goto

  1. The file-open mode __________ is used to open a file for output and move to the end of the file.

ios::out

ios::app

ios::trunc ios::binary

  1. A function’s single most important role is to ____________.

give a name to a block of code increases program size

accept arguments and provide a return value

help in organizing a program into conceptual units

  1. In C++, Integer calculation occurs in _____ bytes.

1 byte 2 bytes

4 bytes

8 bytes

  1. The function write() takes ___________________as parameter(s).

String of pointer type String of variable lengths, no. of bytes to be read and flags Pointer array of characters and a delimiter

String and no. of bytes to be written

  1. A ________ name includes a primary name and an optional period with an extension.

File

Disk Data Database

  1. In case of pass by reference, _______________.

The values of the variables are passed to the function so that it can manipulate them

The location of variable in memory is passed to the function

The function declaration should contain ampersand (&) in its type declaration Temporary variables are created to store the values of the variables passed

Q20. There is a pointer variable named ptr of type float then address of which type of variable the ptr will store in it?

int

float

char double

  1. If char Array[7]; is a character array then write the statement which store a character at Fifth location of this array.02

Answer: Array[4] = ‘a’;

  1. What happens, if we open an existing file using the default output mode and write the data into the file?02

It will start writing from start of file. And will overwrite existing data/text.

  1. Perform left shift operation on a binary number 0101 and write the result in binary and decimal.03

Binary = 1000

Decimal = 8

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

#include <iostream> using namespace std;

union Num

int ValueI; float ValueF; double ValueD; char ValueC;

void main()

// Optional union keyword // ValueI = 100 Num TestVal = {100};

cout<<"\nInteger = "<< TestVal. ValueI<<endl; TestVal. ValueF = 2.123; cout<<" Float = "<< TestVal. ValueF<<endl; cout<<" Uninitialzed double = "<< TestVal. ValueD<<endl; cout<<" Some rubbish???"<<endl; TestVal. ValueC = 'U';

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.