Programming Fundamentals, Past Papers

Programming Fundamentals MScIT 1st Term 2014 Past Paper UOS

Programming Fundamentals MScIT 1st Term 2014 Past Paper UOS

University of Sargodha
M. Sc. I. T, First Term Exam 2014
Subject: Information Technology
Paper: Programming Fundamentals (CMP: 2122)
Time Allowed: 2:30 Hour
Maximum Marks: 60

Objective Part (2*12)

Q.1. Write short answers of the following on your answer sheet.

i. What is the difference between while and do-while loops?
ii. What is struct keyword in C?
iii. Why main function is necessary in each C program?
iv. What is the use of compiler in C language?
v. Convert following algebraic equation into C expression

vi. What is flow-chart?
vii. What is continue statement?
viii. What is function prototype in C?
ix. Give 2-dimensional C array declarations of different types.
x. What is pass by reference in C? Give suitable example.
xi. What is the relationship between C pointers and arrays?
xii. What is switch statement?

Subjective Part (9*4)

Q.2. Develop a C program to sort array of following data: 78, 23, 45, 12, 60, 67, 32.

Q.3. Develop a C program to read the temperature of a week on daily basis, and print the temperature in ascending order.

Q.4. Develop a C program to calculate the cube value of number given by a user.

Q.5. Draw flow-chart and develop a C program to find class average grade with counter controlled repetition.

Q.6. Write a function to calculate the factorial of any integer number given by user and use this function into a C program.

Q.7. Write a program that has a structure to store Date (day, month, year), create two Date type variables, use these variables to store two dates and display these dates.