Home /University Of Sargodha (UOS) /Programming Fundamentals

Subject: CS Time Allowed: 2:30 Hours University of Sargodha BS 1" Term Examination 2015 Paper: Programming Fundamentals (CMP-2122) Maximum Marks: 60

Subject: CS Time Allowed: 2:30 Hours University of Sargodha BS 1" Term Examination 2015 Paper: Programming Fundamentals (CMP-2122) Maximum Marks: 60 — 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

Subject: CS

Time Allowed: 2:30 Hours

University of Sargodha

BS 1" Term Examination 2015

Paper: Programming Fundamentals (CMP-2122)

Maximum Marks: 60

Objective Part

Compulsory

Note: Attempt all questions each question carry equal marks?

(2*12=24)

i. What is preprocessor directive?

Write three rules of declaring an identifier in C program.

ili.Differentiate while and do-whileloop?

iv.

What are primitive data types? Shortly discuss one of them.

V.

vi.

What are difference b/w pre-increment&post-increment operators?stadni.com

What is control structure?

vil.

What is logical error and why is it the most difficult error to find?

vili.

Difference b/w built-in and userdefined function.

ix.

What is the purpose of getch?

X.

Differentiate 1-D array and 2-D array.

xi.

What is apointer?

xii.

In file-processing why a programmer use gets and fputs functions in C program.

Subjective: (4*9=36)

Note: Attempt any four questions.

Q

2. Write a program that find the sum of the following series using nested loop.

2

3

2i+

- +

- +

4

5

+-

3!

4!

5!

6!

Q

3. Write a program that calculates four-function(+, -, *, ) calculator. It asks the user to input

two numbers and an operatorfrom the prompt.

Q

4. Write a user-defined function to read the content from a text file OUT.txt, count and

display the number of alphabetsand digits present in it.

Q

5. Write a program that accepts an integer value from the user and passes that to a function by

reference. If the number is positive, then function finds the square of the value. The updated

value is display by main function.

Q

6. Write a program that accepts 10 elements of an integer array from the user. The array and

its SIZE passes to user define functionthat finds the sum and average of integer array.

Q7. Write a program that declares a structure PERSON to store income (float), tax_rate(int)

and tax_of_a_person(float). The program defines an array of structure to store the record of

five persons. It inputs incomes and tax rate of five Persons and then displays the tax payable

(by each person).

visit website: ustadni.com