CS201 Mid Term Past Paper 2 study with hamza 25.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
PDF
Type
Midterm
Coverage
Mid-Term Exam Scope (Lectures 1 to 22)
Tags
PAST-PAPER, 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

  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)

Frequently asked questions

Where can I download CS201 Mid Term Past Paper 2 study with hamza 25.pdf for free?

You can preview and download "CS201 Mid Term Past Paper 2 study with hamza 25.pdf" (CS201 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs201-mid-term-past-paper-2-study-with-hamza-25-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

To access the data members of structure, _______ is used.
► dot operator
► dereference operator
► logical operator
► address operator
C is widely known as development language of _______ operating system.
► Linux
► Windows
► Unix
► Mac OS
What will be the result of arithmetic expression 6+27/3*3?
► 33
► 45
►9
► 30
How many bytes are occupied by declaring following array of characters?
char str[] = “programming”;
► 10
► 11
► 12
► 13
Declaring structures does not mean that memory is allocated.
► True
                                                                     Page 1 of 7
                 For more papers, go to VUAssist.blogspot.com

► False
What will be the value of i and j in the following code segment?
int i, j ;
int x[5] = {2, 3, 4, 8, 9} ;
int *ptr =&x[2];
i = (*ptr)++ ;
j = *ptr++ ;
► i = 5, j = 5
► i = 5, j = 8
► i = 4, j = 8
► i = 5, j = 9
When an array element is passed to a function, it is passed by ----------------.
► reference
► data type
► value
► data

Which of the following is a correct way to initialize a variable x of int type with
value 10?
► int x ; x = 10;
► int x = 10;

► int x, x = 10;
► x = 10;

                                                                             Page 2 of 7
                    For more papers, go to VUAssist.blogspot.com

In C, direction of expression evaluation is from _______________.
► Right to Left
► Left to Left
► Left to Right
► Right to Right
What is the size of following array?
char str[] = “abcd”;
►2
►3
►4
►5
Let ptr1 and ptr2 are pointer variables that points to integer data types then
which one of the following arithmetic is allowed?
► ptr1 + ptr2
► ptr1 - ptr2
► ptr1 * ptr2
► ptr1 / ptr2
A variable declared inside a code block becomes ________ variable for that
block.
► Global
► Static
► Local
► Inner
                                                                         Page 3 of 7
                   For more papers, go to VUAssist.blogspot.com

From the options given below, identify the correct output of following code
segment.
main(){
int x = 5 ;
{
int x = 4 ;
cout << x << “,” ;
}
cout << x ;
}
►5,5
►4,4

►4,5
►5,4
Determine the output of the following while loop.
int counter = 0 ;
while(counter < 5)
cout << counter << “ ”;
counter++;
►54321
► Infinite loop
►1234

                                                                       Page 4 of 7
                     For more papers, go to VUAssist.blogspot.com

►12345
What will be the correct syntax for initialization of a pointer ptr with string
"programming"?
► char *ptr = ‘programming’ ;
► *ptr = “programming” ;
► char ptr = ’programming’ ;
► char *ptr = “programming” ;
Correcting the errors from a program is termed as __________ .
► Linking
► Loading
► Debugging
► Editing
______ is the pointer which determines the position in a file from where the
next read operation occurs.
► Put
► Seek
► Get
► Tell

The function tellg() returns the current location of the ______ pointer.
► Get
► Tellptr
► Write

                                                                            Page 5 of 7
                  For more papers, go to VUAssist.blogspot.com

► Seekg

The memory address of the first element of an array is called
► floor address
► foundation address
► first address
► base address
'while' loop becomes infinite when __________ .
► the condition is always false
► the condition is less than zero
► the condition is always true
► the condition contains a logical operator

Questions:
   1. Write the code to access the element at third row and second column of a
      2D array uses pointer named array ptr.
   2. Identify each of these functions as character conversion functions or
      manipulation functions.
            1. int isprint( int c )
            2. int tolower( int c )
   3. Assume that you write a program to read the data from a text file. You
      have two options to do it, either reading the data character by character

                                                                        Page 6 of 7
                  For more papers, go to VUAssist.blogspot.com

   or reading multiple lines of data at a time. Which option do you think is
   more better and Why ?
4. Write a program that prompts the user to enter 10 values in an array.
   Program should sort the array in increasing order and finds maximum and
   minimum number in the array.
   Hint: Once the array is sorted finding minimum and maximum values is
   very easy.
5. Explain the logic of the given program code.
         main()
         {
         ofstream outfile;
         char outfilename[] = "abc.txt";
         char outputtext[50] = "Welcome to VU";
         outfile.open(outfilename, ios::out);
         if(!outfile)
         {
         cout<<"Error Occured";
         exit(1);
         }
         outfile<<"Hello Buddies..."<<outputtext;
         outfile.close();
         }

                                                                      Page 7 of 7
                For more papers, go to VUAssist.blogspot.com

More CS201 files

All CS201 files · Midterm Prep 2026 · MCQs Bank