- Type
- Midterm past paper
- Course
- CS201 Introduction to Programming
- Size
- PDF 97 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 4. Download the file for all 4 pages.
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?
#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;
Related CS201 files
All CS201 files →- CS201 Midterm Subjective 2010-2019 Midterm PDF 258 KB
- CS201 Midterm Past Paper Spring 2010 Midterm DOC 20 KB
- CS201 Midterm Solved Paper 2014 Midterm DOC 180 KB
- CS201 Midterm Solved Quiz 1 2015 Midterm DOCX 20 KB
- CS201 Highlighted Handouts by VUBuddy Highlighted PDF 3.8 MB
- CS201 Quiz by Abdullah Quiz PDF 512 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.