- Type
- Midterm past paper
- Course
- CS201 Introduction to Programming
- Size
- PDF 60 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, 3 of 5. Download the file for all 5 pages.
- 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
- 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
- Which of the following is not a reserve word for data types in standard C/C++? int
float
real
double
- To assigned a value to a character type variable, ________ are used around the value.
parenthesis ( )
single qoutes ' '
double qoutes " " curly braces { }
- 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
- In programming, comments are used to explain the functioning of the _______ . Debugger
Editor
Program
Linker
- Operating System is a type of a/an ___________.
application software
system software
computer language interpreter
- _________ are very good tools for code reuse.
operators loops
functions
variables
- Identify the correct option which is used for calling the function int square (int *).
square(int &num) ;
square(&num) ;
square(*num) ; square(num) ;
- The _________ statement allows us to select from multiple choices based on a set of fixed values for a given expression.
switch
break continue goto
- 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
- 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
- In C++, Integer calculation occurs in _____ bytes.
1 byte 2 bytes
4 bytes
8 bytes
- 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
- A ________ name includes a primary name and an optional period with an extension.
File
Disk Data Database
- 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
- 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’;
- 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.
- 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';
Related CS201 files
All CS201 files →- CS201 Midterm Past Papers by Junaid Midterm PDF 1.2 MB
- CS201 Midterm Solved Subjective with References by Moaaz Midterm PDF 1.3 MB
- CS201 Midterm Solved File 4 by Team Hadi Midterm PDF 4 MB
- CS201 Midterm MCQs Set 2 by VU Topper RM Midterm PDF 690 KB
- CS201 Handouts Handout PDF 8 MB
- CS201 Quiz 3 Quiz PDF 1.7 MB
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.