0% found this document useful (0 votes)
76 views1 page

Air University Multan Campus Lab Final Examination: Fall, 2020

The document is the lab final examination for Programming Fundamentals from Air University Multan Campus. It consists of 5 questions worth a total of 45 marks. Question 1 asks students to write a program that takes 10 integers from the user, sums the even numbers, and writes the even numbers and total sum to a text file. Question 2 asks students to write a program that returns the factorial of a passed number. Question 3 asks students to write a function that determines the median of an integer array using pointers. Question 4 asks students to write a function that displays a passed C-string backward. Question 5 asks students reflective questions about the course.

Uploaded by

Muhammad Yasir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views1 page

Air University Multan Campus Lab Final Examination: Fall, 2020

The document is the lab final examination for Programming Fundamentals from Air University Multan Campus. It consists of 5 questions worth a total of 45 marks. Question 1 asks students to write a program that takes 10 integers from the user, sums the even numbers, and writes the even numbers and total sum to a text file. Question 2 asks students to write a program that returns the factorial of a passed number. Question 3 asks students to write a function that determines the median of an integer array using pointers. Question 4 asks students to write a function that displays a passed C-string backward. Question 5 asks students reflective questions about the course.

Uploaded by

Muhammad Yasir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Air University Multan Campus

Lab Final Examination: Fall, 2020

Subject Programing Fundamental Total Marks 45


Course Code CS-111L Date 04-02-2021
Class BSCS Time 09:00 AM – 12:00 PM
Semester 1st Max. Time 3 hrs.
Allowed
Section B Instructor Name Muhammad Yasir Khan
Signature

All questions are mandatory.


1- Write a program to which ask the user to enter 10 integers. Then using a function, it should
sum only even numbers in the array and them write those even numbers and total sum in a
text file. [10]

2- Write a program in C++ which return factorial of a number passed as an argument. [10]

3- In statistics, when a set of values is sorted in ascending or descending order, its median is the
middle value. If the set contains an even number of values, the median is the mean, or
average, of the two middle values. Write a function that accepts as arguments the following:
 An array of integers
 An integer that indicates the number of elements in the array
The function should determine the median of the array. This value should be returned as a
double. (Assume the values in the array are already sorted.) Use pointer notation instead of
array notation in this function. [10]
4- Write a function that accepts a pointer to a C-string as an argument and displays its contents
backward. For instance, if the string argument is Gravity the function should display ytivarG.
Demonstrate the function in a program that asks the user to input a string and then passes it to
the function. [10]

5- Attempt this question on back side of your question paper and submit to the invigilator. [5]
a. What was the best thing you learnt in this course?
b. What was the most difficult topic or concept in this course.
c. How can I improve my method of teaching to deliver the concept properly?
Feel free to answer. It won’t affect you in any way.
Happy Coding 

You might also like