Skip to content
VUBuddy

CS201 Midterm Questions

Introduction to Programming PDF 186 KBUpdated 23 Oct 2026
Midterm past paper CS201 Midterm Questions PDF 186 KB
vubuddy.com
Type
Midterm past paper
Course
CS201 Introduction to Programming
Size
PDF 186 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 186 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 11. Download the file for all 11 pages.

paper tough tha mcqs b ajeeb say thay exact to yaad nahi but kuch aisay thay questions Q write a code to open a file, file name is "myfile.txt" Q write a structure whos name is Inventory etc 3marks Q declare 2-dimentional array and then assign pointer to this array 2 marks Q aik code diya tha us ka output batana tha ....strtok wala code tha for 5 marks Q write a code which pass camand line argument to main and return integer 3 marks Q if p and q are int pointer and n is integer then the followings are legal or illigal 5marks 1 p - q 2 p-n 3 q+n 4 q+ p 5 n +p ( in mein yad nahi * ya / b hai tha ya ni)

CS201 MID TERM Current Papers Dec.-2012 Fall

Cs 201 current paper :

20 mcqs and 2 3 question of 2 marks 2 question of 3 marks ,2 question of 5 marks

Q.A two-dimensional array has 3 rows and 4 columns. Write down the syntax to initialize first element of all three rows of two-dimensional array with value 2.

Q.Identify the errors in the following code segment and give the reason of errors main(){ int x = 10

*ptr = 5 ;

Q. Write the syntax of outfile.text ?

Q Advantage of close() file

  1. 3. What a problem in the given code. How can you correct it. Cout”p=”p”,p+q=”p+qend1; Marks(2)
  2. 4. what is error in this code and give reason of error.

main()

Intx=10;

*ptr = 5; } Marks(3) Sequential and random method. In given 2 method wich one is best and why? Marks(3) 5. write a programe that prompt the user to enter the value in an array programe should sort the array in increasing order and found the maximum and minimum number in the array. Marks(5)

  1. 6. write a programme which create a new file having name cs201.txt and write introduction to programming taught by Dr Naveed Malik” in it.

And after that print the content of this text file an the screen using getline function. Marks(5)

objective may say kuch bata deta hoo jo aya tha mujhay;

  • C-language kis labortary may invent hoi.

C is widely known as development language of _______ operating system.

  1. Linux
  2. Windows
  3. Unix
  4. Mac OS

What will be the result of arithmetic expression 6+27/3*3?

  1. 33
  2. 45
  3. 9
  4. 30

What will be the correct syntax for initialization of pointer ptr with string "programming"?

  1. char ptr = ’programming’ ;
  2. char *ptr = “programming” ;
  3. char *ptr = ‘programming’ ;
  4. *ptr = “programming” ;

Which character is inserted at the end of string to indicate the end of string?

  1. new line
  2. tab
  3. null
  4. carriage return
  • ek question that like variable say related jis ki option kuch is tarah say the;

int (i)

int [2]

and subjective may say;

Q1. Write down the output of the following code?

int array[7], sum = 0;

for(int i=0;i<7;i++)

array = i;

sum+= array;

cout “ Sum = “ sum;

Q2. Explain C-String with an example?

Q3. anonymous structure and anonymous union k baray likhain?

Q4. 2 question practical related thay jis may code dya gya tha us ko theek kerna tha

geek ki option say.[/b]

one more

long questions in CS201 midterm paper are

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.