CS201 Viva & Paper Best Preparation .pdf

Verified academic study resource for CS201 (Introduction to Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Mega Solved MCQs Question Bank) covers Full Course Curriculum spanning approximately 180 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
MCQ Bank
Coverage
Full Course Curriculum

Cross-verify solutions against official lecture handouts. Practice active recall before checking answers to ensure true concept retention.

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 Viva & Paper Best Preparation .pdf for free?

You can preview and download "CS201 Viva & Paper Best Preparation .pdf" (CS201 PDF, ~180 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs201-viva-paper-best-preparation-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

 CS201 Viva & Paper
Best Preparation By Vu Topper RM

 For More Help Contact What’s app 03224021365

1. Syntax of Code:
         #include <iostream>
         using namespace std;
         int main ()
        {
         cout<< "Hello World!";
         return 0;
         }
2. Data types:

                Datatype with Variable
              Declaration:     Int a;
              Initiation:      Int a=10;

  Explanation:
  Datatype (Int), Variable (a),
  Assignment operator (=), Value (10),
  End of statement (;).

  Int: Store numerical data (1,2,3,4.…………)

  String:    Store Alphabetic data (A,a,b,c…… Ali)

  Float: Store dot(.)value mean percentage (10.12).

  Double: Store numerical data (12.400,14.800)

For More Help Contact What’s app 03224021365

3. Variable:
    Koi Bi Alphabetic Name Ho Sakta Hai.
   For example, Ali, Ayesha, Hamza, Shan, A, B, C.

4. Function:
           Input + Processing + Output
   For example (A+B). Input(A), Processing (+),
   Output (Result). Mean + is a function

5. Classes:

  3 Type Public, Protected, Private.
  Class is a just template, blue print, structure.
  Class Khud Kuch Bi Nhi Hoti.

6. Objects:
   Object is a property of class and three type of object.
   i) Attribute      ii) Behavior        iii) Exitance

  For example, Ali is a object.
  i) Attribute    Hight, color, address,
  ii) Behavior    Walking, eating, sleeping
  iii) Exitance   Area cover.

7. Array:
   Collection of Data and Always Start 0.
   Declaration with [ ] brackets. Honda
   For example, Declaration size of honda [4]:

For More Help Contact What’s app 03224021365

Array Code:
    // This program reads the input from user and store it into an array and stop at -1.
#include<iostream.h>
Main ( )
{
int c [ 100 ] ;
int z , i = 0 ;
do {
cout << “Please enter the number (-1 to end input) “ << endl;
cin >> z ;
if ( z != -1 )
{
c[ i ] = z ;
}
i ++ ;
} while ( z != -1 && i < 100 ) ;
cout << “ The total number of positive integers entered by user is “ << i
-1;
}

Output:
Please enter the number (-1 to end input) 1
2
3
4
5
6
-1
The total number of positive integers entered by user is 6

  8. Loop:
     Three types:
     i) While Loop                   ii) Do While Loop                       iii) For Loop

   For More Help Contact What’s app 03224021365

i) While Loop code:
Syntax
while (condition) {
  // code block to be executed
}
Example

int i = 0;
while (i < 5) {
  cout << i << "\n";
  i++;
}

Output:
0
1
2
3
4

ii) Do While Loop code:
Syntax
do {
  // code block to be executed
}
while (condition);

Example
int i = 0;
do {
  cout << i << "\n";
  i++;
}
while (i < 5);

   For More Help Contact What’s app 03224021365

Output:
0
1
2
3
4

iii) For Loop code:
Syntax
for (statement 1; statement 2; statement 3) {
  // code block to be executed
}

Example
for (int i = 0; i < 5; i++) {
  cout << i << "\n";
}

Output:
0
1
2
3
4

   9. Condition:
      Three types:
      i) If                      ii) If else           iii) Switch Statement

i) If Code:
Syntax
if (condition) {
  // block of code to be executed if the condition is true
}

    For More Help Contact What’s app 03224021365

Example
int x = 20;
int y = 18;
if (x > y) {
  cout << "x is greater than y";
}

Output:      x is greater than y

ii) If else code:
Syntax
if (condition) {
  // block of code if condition is true
}
else {
  // block of code if condition is false
}

Example
// Program to check whether an integer is positive or negative
// This program considers 0 as a positive number

#include <iostream>
using namespace std;
int main() {
  int number;
  cout << "Enter an integer: ";
  cin >> number;
  if (number >= 0) {
    cout << "You entered a positive integer: " << number << endl;
  }
  else {
    cout << "You entered a negative integer: " << number << endl;
  }
  cout << "This line is always printed.";
  return 0;
}

Output 1:

    For More Help Contact What’s app 03224021365

Enter an integer: 4
You entered a positive integer: 4.
This line is always printed.

Output 2:
Enter an integer: -4
You entered a negative integer: -4.
This line is always printed.

   10. Pointer:
     Pointer is a Reference variable and sign of pointer &

   11.       Operator:
                                      (+,-,*,/,)

   12.       Call by value:
In call by value, original value is not modified.
In call by value, value being passed to the function is locally stored by the function
parameter in stack memory location. If you change the value of function
parameter, it is changed for the current function only. It will not change the value
of variable inside the caller method such as main ().

Let's try to understand the concept of call by value in C++ language by the
example given below:
#include <iostream>
using namespace std;
void change(int data);
int main()
{
int data = 3;
change(data);

    For More Help Contact What’s app 03224021365

cout << "Value of the data is: " << data<< endl;
return 0;
}
void change(int data)
{
data = 5;
}
Output: Value of the data is 3

   13.      Call by reference:
In call by reference, original value is modified because we pass
reference (address).
Here, address of the value is passed in the function, so actual and formal
arguments share the same address space. Hence, value changed inside
the function, is reflected inside as well as outside the function.

Note: To understand the call by reference, you must have the basic
knowledge of pointers.

Let's try to understand the concept of call by reference in C++ language by
the example given below:

#include<iostream>
using namespace std;
void swap(int *x, int *y)
{
int swap;
swap=*x;
*x=*y;
*y=swap; }
int main() {
int x=500, y=100;
swap(&x, &y); // passing value to function
cout<<"Value of x is: "<<x<<endl;

   For More Help Contact What’s app 03224021365

cout<<"Value of y is: "<<y<<endl;
return 0; }

Output: Value of x is: 100. Value of y is: 500

   14.      Constructors:
A constructor in C++ is a special method that is automatically called
when an object of a class is created.
To create a constructor, use the same name as the class, followed by
parentheses ():

More CS201 files

All CS201 files · Midterm Prep 2026 · MCQs Bank