Sample Paper of CS201.docx

Verified academic study resource for CS201 (Introduction to Programming) under the Computer Science at Virtual University of Pakistan. This DOC 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
DOC
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 Sample Paper of CS201.docx for free?

You can preview and download "Sample Paper of CS201.docx" (CS201 DOC, ~180 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/sample-paper-of-cs201-docx) 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

Sample Paper
 FINALTERM EXAMINATION
Fall 2022
CS201 – Introduction to Programming


Time: 90 min
Marks: 60

Question No: 1      (Marks: 01) - Please choose the correct option


…………. function is used to determine the current location while reading a file.

    A. tellp()
    B. tellg()
    C. seekp()
    D. seekg()

Question No: 2      (Marks: 01) - Please choose the correct option


…………. operator can be used for masking of flags.

    A. ^
    B. &&
    C. ||
    D. >>

Question No: 3      (Marks: 01) - Please choose the correct option


What will be the output of the following code?

 int main(){
    int i = 20;

    for(int i=1;i<10;i++);
    cout<<i;

    return 0;
}

    A. 10
    B. 20
    C. 9
    D. 1

Question No: 4      (Marks: 01) - Please choose the correct option


What will be the output of the following code?

int main() {
  change();
  return 0;
}
int change (int a=12){
   int b=12;
   a = a + b;
  cout<<a++;
}

    A. 12
    B. 24
    C. 25
    D. 26

Question No: 5      (Marks: 01) - Please choose the correct option


While handling files in C++, the default mode of “ifstream” library for opening file is.
    A. ios::ate
    B. ios::out
    C. ios::in
    D. ios::app

Question No: 6      (Marks: 01) - Please choose the correct option


In C++, “getline()” function is a built-in function that allows accepting and reading.
    A. Single line
    B. Multiple lines
    C. Single and Multiple lines
    D. Only multiword input

Question No: 7      (Marks: 01) - Please choose the correct option


Which one of the following is correct definition of structure?
    A. struct Student{char name[30]}
    B. struct Student {char name[30];}
    C. struct Student {char name[35];};
    D. struct {char name[30]};

Question No: 8      (Marks: 01) - Please choose the correct option


struct book {
 char title[20];
};

int main(){
 book * sptr;
}

From the above code the correct way to access the data member title of the structure book through pointer is?

    A. sptr.title
    B. sptr:title
    C. sptr->title
    D. .sptr*title

Question No: 9      (Marks: 01) - Please choose the correct option


What will be the output of the following program?

#include <iostream>
  #define LIMIT 3

int main()
{
    for (int i = 2; i < LIMIT; i++) {
        std::cout << i* LIMIT << "\t";
    }
    return 0;
}
    A. 6
    B. 2	3	6
    C. 3
    D. 9

Question No: 10      (Marks: 01) - Please choose the correct option


The proper way of defining a macro is.
    A.  #define SIZE 5;
    B. #define SIZE 5
    C.  Set SIZE 5;
    D. #set SIZE 5

Question No: 11      (Marks: 01) - Please choose the correct option


In C++, dynamic memory allocation in done on _____ memory.

    A. Static
    B. Stack
    C. Heap
    D. Hard Disk

Question No: 12      (Marks: 01) - Please choose the correct option


Which of the following is not an acceptable class specifier?
    A. public
    B. private
    C. protected
    D. pointer

Question No: 13      (Marks: 01) - Please choose the correct option


_____ is another name for a class's data members.

    A. Attribute
    B. Method
    C. Instance
    D. Dimensions

Question No: 14      (Marks: 01) - Please choose the correct option


In C++, class data members are generally kept as ______.
    A. public
    B. private
    C. protected
    D. static

Question No: 15      (Marks: 01) - Please choose the correct option


To declare the friend function, which keyword is used?
    A. Friend
    B. FRIEND
    C. FrienD
    D. friend

Question No: 16      (Marks: 01) - Please choose the correct option


In C++, which of the following operator cannot be overloaded?

    A. +
    B. -
    C. /
    D. ->

Question No: 17     (Marks: 01) - Please choose the correct option


A class includes both data members as well as functions to manipulate the data. These functions are called ___________.

    A. Member functions
    B. Constant functions
    C. Rational functions
    D. Memory functions

Question No: 18      (Marks: 01) - Please choose the correct option


Which of the following is known as an instance of a class?

    A. Data member
    B. Constructor
    C. Member function
    D. Object

Question No: 19      (Marks: 01) - Please choose the correct option


In friend function, which operator is utilized to access members of a class using class objects.

    A. ::
    B. +
    C. *
    D. .

Question No: 20      (Marks: 01) - Please choose the correct option


Which of the following is the correct way of referring a data member “buf” of a class name “String”?  Consider “buf” data member declared as a character pointer.

        A. buf;
        B. this->buf;
        C. *(this).buf;
        D. *this.buf

Question No: 21      (Marks: 01) - Please choose the correct option


In C++, which of the following operator can be overloaded?

    A. sizeof
    B. ?:
    C. ::
    D. %

Question No: 22      (Marks: 01) - Please choose the correct option


When a unary operator is overloaded and is a member of a class, how many arguments need to be passed explicitly when it is called?

    A. Zero
    B. One
    C. Two
    D. Three

Question No: 23      (Marks: 01) - Please choose the correct option


What will be the output of following program in C++?

#include<iostream>
using namespace std;
class A
{
	int a;
	public:
		A(int x):a(x){}
		int geta() {return a;}
};
int main ()
{
    A M(10),N(20);
    N = M;
    cout<<N.geta();
    return 0;
}

    A. 20
    B. 10
    C. 30
    D. 15

Question No:24     (Marks: 01) - Please choose the correct option


Which of the following manipulators “Terminate a string with NULL”?

    A. endl
    B. flush
    C. ends
    D. ws

Question No: 25      (Marks: 01) - Please choose the correct option


What will be the output of following code snippet written in C++?
  int main(){
   double var = 3.14362987;
   cout<< setprecision(4) << var;
  }

    A. 3.144
    B. 3.143
    C. 3.1436
    D. 3.145

Question No: 26     (Marks: 01) - Please choose the correct option


Which of the following is not a format state flag?

    A. ios::dec
    B. ios::showpoint

More CS201 files

All CS201 files · Midterm Prep 2026 · MCQs Bank