Skip to content
VUBuddy

CS201 Midterm Solved MCQs by Waqar Siddhu

Introduction to Programming PDF 451 KBUpdated 23 Oct 2026
Midterm past paper CS201 Midterm Solved MCQs by Waqar Siddhu PDF 451 KB
vubuddy.com
Type
Midterm past paper
Course
CS201 Introduction to Programming
Size
PDF 451 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 451 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 20. Download the file for all 20 pages.

CS201 Midterm McQs Solved Papers By Waqar Sidhu

(File 1)

Q1. Consider the following code segment. What will be the output of following code?

int addValue (int*a){ int b = (*a) + 2; return b;

main() { int x=6; cout<< x<< “,”; cout<<addValue(&x) << “x”; cout<< x;

  •  6,6,8
  •  6,8,8
  •  6,6,6

Q2. Here the code is given below. You have to identify the problem in the code. while (i < 10) && (i > 24))

  •  The while loop is an exit-condition loop
  •  The test condition is always true

Q3. The correct syntax of do-while loop is ________.

  •  (condition) while; do ( {statement,};
  •  {statement;) do-while ();
  •  while(condition); do {statement;};

Q4. Matric is defined as ___________.

  •  Single dimensional array
  •  Vector product
  •  Scalar product

Q5. In programming, comment are used to explain the functioning of the _________.

  •  Debugger
  •  Editor
  •  Linker

Q6. Operating System is a type of a/an ____________.

  •  Application software
  •  Computer language
  •  Interpreter

Q7. From the options given, you need to choose the option which is true for the given code. for (int i = 1; i > 1; i++) {

/* loop code */

  •  The while loop is an exit-condition
  •  The test condition is always false

Q8. Which of the following value are used in C/C++ to represent true and false?

  •  1 and -1
  •  11 and 00
  •  Any numerical value

Q9. ‘while’ loop may execute ________ or more times.

  •  Three
  •  Two
  •  Once

Q10. Body of any function is enclosed within ___________.

Q11. What will be the correct syntax for initialization of a pointer ptr string “programming”?

  •  char ptr = ‘programming’;
  •  char*ptr = ‘programming’;
  •  *ptr = “programming”;

Q12. Which one of the given option is not a mode for reading/writing the data from a file?

  •  in
  •  out
  •  trunc

Q13. ___________ mode allows us to add data or change data anywhere in the file.

  •  iso::app
  •  iso::binary
  •  ios::edit
All CS201 files →
CS201 Introduction to Programming All CS201 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.