CS201 Subjective + program.pdf

Verified academic study resource for CS201 (Introduction to Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Verified Study Resource) covers Full Course Curriculum spanning approximately 280 pages across 8 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
PDF
Type
Study Resource
Coverage
Full Course Curriculum
Tags
SUBJECTIVE

Review this document alongside the official handouts and test your retention in the Interactive MCQs Studio.

What this file covers — CS201 syllabus roadmap

  1. Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
  2. Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
  3. Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
  4. Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
  5. Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
  6. Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
  7. Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
  8. Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)

Frequently asked questions

Where can I download CS201 Subjective + program.pdf for free?

You can preview and download "CS201 Subjective + program.pdf" (CS201 PDF, ~280 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs201-subjective-program-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 Full Course Curriculum across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), 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

     Visit our YouTube Channel for more Free Content : https://www.youtube.com/@BinaryClassroom

                        CS201 Important Subjective and Programs

Question 1:
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 2:
Write the general syntax for the declaration of pre-increment and post-increment
member operator function.
Answer:
Classname operator ++();
Classname operator ++(int);

Question 3:
Give the general syntax of class template.
Answer:
template
Class myclass {---};

Question 4:
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 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 5:
What will be the output of following code, if user input a number 123?
Int input;
Cin>>oct>>input;
Cout<<hex<<input;
Answer:
53

Question 6:
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.
     "All contents within 'CS201 Important MCQ's' + subjective notes, authored by Binary
Classroom, are protected by copyright; reproduction and distribution without explicit permission
                                         is prohibited."

     Visit our YouTube Channel for more Free Content : https://www.youtube.com/@BinaryClassroom

A friend function can access the private variables of class just like a member function.

Question 7:
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-- or ++I,--I. we can not make
unary operator as binary or binary as unary operator.

Question 8:
Which arithmetic operators cannot have floating point operand?
Answer:
Modulus operator

Question 9:
What are manipulators? Give one example.
Answer:
The manipulators are like something that can be inserted into stream, effecting a
change a 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 10:
Write down piece of code that will declare a matrix of 3x3 and initialize all its
location with 0.
Answer:
Int matrix [3][3];
Include <iostream>
Using namespace std;
Int 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;
}
}
Return 0;
}

     "All contents within 'CS201 Important MCQ's' + subjective notes, authored by Binary
Classroom, are protected by copyright; reproduction and distribution without explicit permission
                                         is prohibited."

     Visit our YouTube Channel for more Free Content : https://www.youtube.com/@BinaryClassroom

Question 11:
What is the difference between switch statement and if statement.
Answer:
The “if” statement is use to select among two alternatives. It use 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 12:
How can we initialize data members of contained object at construction time?
Answer:
Initialize list is used to initialize the contained objects at the construction time.

Question 13:
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 scope and in class scope
as member operators.

Question 14:
Suppose there is a template function ‘func’ having argument of type U and return 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,I);

Question 15:
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:
Variable of the inner code is use in the inner code block.

Question 16:
What is the benefit of reference and where can we use it?
Answer:
     "All contents within 'CS201 Important MCQ's' + subjective notes, authored by Binary
Classroom, are protected by copyright; reproduction and distribution without explicit permission
                                         is prohibited."

     Visit our YouTube Channel for more Free Content : https://www.youtube.com/@BinaryClassroom

In reference 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 17:
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 18:
What is difference between endl and \n?
Answer:
Endl is manipulator and it inserts new line character and flushes the stream.
\n is control character which is used to insert line break.

Question 19:
What does code optimization mean?
Answer:

More CS201 files

All CS201 files · Midterm Prep 2026 · MCQs Bank