Home /University Of Sargodha (UOS) /Programming Fundamentals

Programming Fundamentals MPhil Information Technology/MS Information Technology/MSc Information Technology 1 Semester/Term University Of Sargodha (UOS) 2017

Programming Fundamentals MPhil Information Technology/MS Information Technology/MSc Information Technology 1 Semester/Term University Of Sargodha (UOS) 2017 — page 1

Discussion

Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.

Your email is only used to send you replies and occasional Ustadni updates. It is never shown publicly.

Log in to post under your name

No questions yet — be the first to ask.

More Programming Fundamentals papers

See all

Paper text

1

ustadni.com

University of Sargodha

M. Sc. 1" Term Exam 2017.

Subject: Information Technology Paper: Programming Fundamentals (CMP-2122)

Time Allowed: 2:30 Hour

Maximum Marks: 60

Note:

Q

1.

ii.

ili.

iv

V.

vil.

vili.

ix.

x.

XI.

xit.

Objective Part

(Compulsory)

Write short answers of the following in 2-3 lines cach.

What is preprocessor directive?.

What are comments and how do you insert it in a C program?*

Why we use do-while loop in C7»

What is variable initialization and why is it important?*

What is the Lowievel language?

Describe the importance of default statement in switch statements

What are syntax errors? Why does it occur? •

What is the meaning of prototype of a function?

It is necessary to initializetheconstvariable in c? •

Define a structure? *

What is the advantage of an array over individual variables?•

What does the characters "Y" and "w" mean when writing programs that will make use of files?

Subjective Part

(4*9)

02. Write a program that decept your agein years (cype int) and then displays age in days and

Q3.

months.

Write a program that displays the following output using nested loop.

eva ustadni.com

usta

**2

***

Q4. Write a C program that copies the content of text file to other new file.

Q5.

Write a program that takes 10 clements (array) from the user. Using bubblesort, sort the array

поб.

CO in ascending order.

Write a C program to find factorial of a number using function recursion.

Write a four function calculator to perform addition, subtraction, multiplication and division

that takes two operands and an operator from user. Perform this logic by using switch

usta

ustadni.co

Sohail Nawaz

ustadni.com