Skip to content
VUBuddy

CS201 Midterm Past Paper Spring 2006

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

CS201 Introduction to Programming · Mid Term Examination – Spring 2006 · Time Allowed: 90 Minutes · Please · read · the · following · instructions · carefully · before attempting any of the questions:

d. All coding questions should be answered using the C ++ syntax. You are allowed to use the Dev-C++ compiler to write and test your code. If you do so please remember to copy and paste your code into the examination solution area. (Do NOT share your

code; your colleague could get higher marks than you!!)

Q1. Marks : 10

Write the function definitions for the following: a) A function test() that would take three integer values x, y and z (as parameters), find the largest and return the result to the calling function. b) A function sum() that would take the one integer array myArray[ ] of size 10 (as parameter), calculate the sum of the elements of myArray[ ] and display the result. Note: The function sum() returns no value.

Q2. Marks : 6

Write a program that will create and display the following series: 65, 44, 27, 14, 5, 0, -1, 2, 9, 20. Hint:

The series is created by the formula 2x2 – 3x

for x=-5 to 4

The variable x is of type integer.

Q3. Marks : 2

The value of 2*15/3*7+3*2 is

 146  76  8  70

Q4. Marks : 2

Carefully analyze the following lines of code and chose the correct option. ch1=”a”; ch2=’a’;

 ch1 and ch2 are strings  ch1 is string and ch2 is character  ch2 is string and ch1 is character  ch1 and ch2 are characters

Q5. Marks : 2

The size of a double variable is

 2 bytes  4 bytes  8 bytes  10 bytes

Q6. Marks : 2

An array is also called

 an array variable  array declaration  struct  constant pointer

Q7. Marks : 10

What will be the output of the following programs?

  1. Program1

#include <iostream> int main()

unsigned short x = 1;

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

cout << x << endl; x = x << 1;

return 0;

b) Program2

#include <iostream.h> int main()

unsigned short x = 1024;

while(x>=1)

cout <<x << endl; x =x >> 1;

return 0;

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.