Final Exam Spring-2021
Associate Degree Program
Subjective
Subject: Programming Fundamental (Theory)
Submission Day: Wednesday Time: 11:45 AM – 02:45 PM
Submission Date: 30-06-2021 Max. Marks: 40
Instructor: Naseer Ahmed
Please follow the instructions carefully:
1. Write your answers in a Word file and upload the file before the due time on IULMS.
2. Write your name and registration ID on the first page of your Word file.
3. Answer scripts can be uploaded on IULMS within or before its deadline. Therefore,
do not wait for the last hour to avoid any unforeseen problems.
4. Submission of answer copy(ies) will be considered acceptable through IULMS only.
Therefore, do not submit your document through email or any other medium.
5. Use 12 pt. font size and Times New Roman font style along with 1-inch page margins.
6. Follow the requirements of the word limit and the marking criteria while writing your
answers.
7. Provide relevant, original and conceptual answers, as this exam aims to test your ability to
examine, explain, modify or develop concepts discussed in class.
8. Do not copy answers from the internet or other sources. The plagiarism of your answers may
be checked through Turnitin.
9. Recheck your answers before the submission on IULMS to correct any content or language
related errors.
10. Double check your word file before uploading it on IULMS to ensure that you have uploaded
the correct file with your answers.
Q.No.1 (Max Marks: 06)
a) Does a break is required by default case in switch statement?
b) In a switch statement, what will happen if a break statement is omitted?
c) Why is default statement used in switch case in
Q.No.2 (Max Marks: 04)
Write a C program to read the age of a candidate and determine whether it is eligible for casting
his/her own vote.
Test Data:
Input the age of the candidate: 21
Expected Output:
Congratulation! You are eligible for casting your vote.
Q.No.3 (Max Marks: 06)
Write a C program that accepts three integers and find the maximum of three.
Test Data:
Input the first integer: 25
Input the second integer: 35
Input the third integer: 15
Expected Output:
Maximum value of three integers: 35.
Q.No.4 (Max Marks: 04)
a) What is the meaning of base address of the array?
b) In how many ways you can initialized the array?
c) How do you access the values within an array?
d) What is the advantage of an array over individual variables?
Q.No.5 (Max Marks: 04)
a) What is a structure?
b) What are the differences between structures and arrays?
c) Is it necessary that all elements of structure should be different in size?
d) What is the difference between Call by Value and Call by Reference?
Q.No.6 (Max Marks: 06)
Write a C Program to Add Two Distances (in inch-feet system) using Structures
Test Data:
Enter 1st distance
Enter feet: 23
Enter inch: 8.6
Enter 2nd distance
Enter feet: 34
Enter inch: 2.4
Expected Output:
Sum of distance in feet = 57
Sum of distance in inch = 11
Q.No.7 (Max Marks: 06)
a) What is the difference between entry-controlled loop and exit controlled loop?
b) What is an infinite loop?
c) Explain the syntax of for loop
Q.No.8 (Max Marks: 04)
Write a C program to read name age and marks of n number of students from and store them in a
file. If the file previously exits, add the information to the file.