cs201-midterm-solved-subjective-with-reference.pdf
Verified academic study resource for CS201 (Introduction to Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Midterm Solved Past Paper & Revision File) covers Mid-Term Exam Scope (Lectures 1 to 22) spanning approximately 240 pages across 4 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.
- Course
- CS201 – Introduction to Programming
- Faculty
- Computer Science
- Format
- Type
- Midterm
- Coverage
- Mid-Term Exam Scope (Lectures 1 to 22)
- Tags
- SUBJECTIVE, SOLVED, MIDTERM
Focus on core definitions and repeated MCQs from Lectures 1–22. Remember that scoring in the First Half builds your safety buffer toward the mandatory 20% Two-Half passing rule in CS201.
What this file covers — CS201 syllabus roadmap
- Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
- Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
- Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
- Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
Frequently asked questions
Where can I download cs201-midterm-solved-subjective-with-reference.pdf for free?
You can preview and download "cs201-midterm-solved-subjective-with-reference.pdf" (CS201 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs201-midterm-solved-subjective-with-reference-pdf) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS201 file?
This document covers Mid-Term Exam Scope (Lectures 1 to 22) across 4 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.
What is the passing criteria for CS201 under the VU 20% Two-Half Rule?
Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.
Are CS201 solved past papers and handouts verified for 2026 exams?
Yes. All CS201 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.
Inside this file
Page. No. 1/15
CS201 – Introduction to Programmming
Solved Subjective Questions
From spring 2010 Final Term Papers
www.vustudy.com
Question No: 1 ( Marks: 2 )
Write a declaration statement for an array of 10 elements of type float.
Include an initialization statement of the first four elements to 1.0, 2.0,
3.0 and 4.0.
Answer:
float floatArry[10] = {1.0,2.0,3.0,4.0};
Question No: 2 ( Marks: 2 )
Write the general syntax for the declaration of pre-increment and post-
increment member operator function.
Answer:
Classname operator ++(); ---- pre increment
Classname operator ++(int) ---- post increment
Question No: 3 ( Marks: 2 )
Give the general syntax of class template.
Answer:
template
class myclass { ---} ;
Question No: 4 ( Marks: 2 )
What is a truth Table?
Answer:
There are some areas where the decision structures become very
complicated. Sometimes, we find it difficult to evaluate a complicated
logical expression. Sometimes the logic becomes extremely
Page. No. 2/15
complicated so that even writing it as a simple syntax statement in
any language. It becomes complicated to determine what will be
evaluated in what way. We know the concept of truth table. The truth
tables are very important. These are still a tool available for analyzing
logical expressions. We will read logic design in future, which is
actually to do with chips and gates. How we put these things together.
Question No: 5 ( Marks: 2 )
What will be the output of following code, if user input a
number 123?
int input ;
cin >> oct >> input;
cout << hex << input ;
Answer:
53
Rational: it will take 123 as octal and print it in hex form which is 53.
Question No: 6 ( Marks: 2 )
What is principle of friendship in the context of functions and
classes?
Answer:
Class can declare a friend function and someone from outside the class
cannot declare itself friend of a class.
A friend function can access the private variables of class just like a
member function
Question No: 7 ( Marks: 2 )
How many arguments a Unary Operator take? Can we make a
binary operator as unary operator?
Answer:
Unary operator takes only one argument like i++ or i— (Post
increment or post decrement operators for integers) or ++i,--i (Pre
increment or pre decrement operators for integers) ,we can not make
Unary operator as binary or binary as Unary operator.
Page. No. 3/15
Question No: 8 ( Marks: 2 )
Which arithmetic operators cannot have a floating point
operand?
Answer:
Modulus operator:
This operator can only be used with integer operands ONLY
Question No: 9 ( Marks: 2 )
What are manipulators? Give one example.
Answer:
The manipulators are like something that can be inserted into stream,
effecting a change in the behavior. For example, if we have a floating
point number, say pi (л), and have written it as float pi = 3.1415926 ;
Now there is need of printing the value of pi up to two decimal places
i.e. 3.14. This is a formatting functionality. For this, we have
a manipulator that tells about width and number of decimal points of a
number being printed.
Question No: 10 ( Marks: 2 )
Write down piece of code that will declare a matrix of 3x3. And
initialize all its locations with 0;
Answer:
int matrix [3] [3] ;
include<iostream.h>
main () {
int matrix [3][3];
int inivalue = 0;
for (int a=0;a<3;a++)
{ for (int b = 0;b<3;b++)
{ matrix[a][b]= inivalue;
cout<<matrix[a][b]<<endl;}}
}
Page. No. 4/15
Question No: 11 ( Marks: 2 )
What is the difference between switch statement
and if statement.
Answer:
The “If” statement is used to select among two alternatives. It uses a
Boolean expression to decide which alternative should be executed.
The switch statement is used to select among multiple alternatives. It
uses an int expression to determine which alternative should be
executed.
Question No: 12 ( Marks: 2 )
How can we initialize data members of contained object at
construction time?
Answer:
Initializer list is used to initialize the contained objects at the
construction time.
Question No: 13 ( Marks: 2 )
Can we overload new and delete operators?
Answer:
Yes, it is possible to overload new and delete operators to customize
memory management. These operators can be overloaded in global
(non-member) scope and in class scope as member operators.
Question No: 14 ( Marks: 2 )
Suppose there is a template function ‘func’ having argument of
type U and return type T. What will be the C++ syntax to call
this function, passing a variable ‘x’ of type double and
returning an int type?
Answer:
template <class T, class U>
T func (T a, U b) {
return (a<b?a:b);
}
calling
int i;
double x;
x = func<int,double> (j,l);
Page. No. 5/15
Question No: 15 ( Marks: 2 )
Which variable will be used in inner code block if we have the
same names of variable at outer code block and inner code
block?
Answer:
Simply: variable of the inner code is use in the inner code block.
Question No: 16 ( Marks: 2 )
What is the benefit of reference and where can we use it?
Answer:
In references we give the memory address of the object, due to
references we pass values without making the copy. Hence, when we
have many values & we want efficiency we use references to avoid
copy.
Question No: 17 ( Marks: 2 )
Write the C++ code for the declaration of overloaded stream
insertion and stream extraction operator for the object d of
type Date.
Answer:
Date operator >> (date & d1){
cout<<d1.day<<”-”<<d1.month<<”-”<<d1.year;
}
Question No: 18 ( Marks: 2 )
What is difference between endl and \n?
Answer:
Endl is manipulator and it inserts new line character and flushes the
stream.
Page. No. 6/15More CS201 files
- 1_CS201 MID TERM SOLVED PAPER.docx (DOC · Midterm)
- 1_CS201 MID TERM SOLVED PAPER.pdf (PDF · Midterm)
- 23.-Download_CS201-Midterm-Solved-MCQs-with-Reference-Sadia- (PDF · Midterm)
- CS201 GRAND QUIZ MIDTERM 2020.pdf (PDF · Midterm)
- CS201 Grand Quiz for Mid Term Prepration by VU Stars.pdf (PDF · Midterm)
- CS201 MID TERM SOLVED PAPER-1.doc (DOC · Midterm)
- CS201 MID TERM SOLVED PAPER.doc (DOC · Midterm)
- CS201 MID Term Solved MCQs Mega File.pdf (PDF · Midterm)