You are on page 1of 3

CE-112L Computer Programming Lab Spring 2022

Air University
Lab Midterm Examination: Spring 2022

Subject: Computer Programming Lab Total Marks: 55


Course Code: CE-112L Date: 28 Mar 2022
Class: BEMTS-A & B, BEEP-A Max. Time Allowed: 90 minutes
Semester: 2nd LE Name: M. Farooq Khan
Paper: C Student Roll #:

INSTRUCTIONS:
- This is a CLOSED BOOK/ CLOSED NOTES examination and the use of C++ compiler on mobile
phone or computer is not allowed during the exam.
- Write codes on the backside of the question paper. 1 question on each page.
- In Q#4, do not write anything else other than the final outputs in the specified boxes, marks will be
deducted otherwise. You can use extra pages for rough work.
Question # 01: Marks: 10 (CLO-1)
Write a program that inputs 2 numbers, swaps these values without using a third variable, and
displays them.
EXAMPLE OUTPUT:

Question # 02: Marks: 10 (CLO-1)


Write a program that inputs salary and grade. It adds a 40% bonus if the grade is greater than
16. It adds a 15% bonus if the grade is 16 or less and then displays the total salary.

Question # 03: Marks: 10 (CLO-1)


Write a program that draws a rectangle represented by ones using LOOPS. Take the height and
width of the rectangle from the user as shown below.

Lab Midterm Examination Good Luck ☺ Page 1 of 3


CE-112L Computer Programming Lab Spring 2022

Question # 04: Marks: 4+6+5+5+5 = 25 (CLO-1)


Write the output of the following codes? Do not write anything else other than the final output
in the specified boxes.

# CODES OUTPUTS

Lab Midterm Examination Good Luck ☺ Page 2 of 3


CE-112L Computer Programming Lab Spring 2022

# CODES OUTPUTS

Lab Midterm Examination Good Luck ☺ Page 3 of 3

You might also like