Subject: CS Time Allowed: 2:30 Hours University of Sargodha BS 1" Term Examination 2015 Paper: Programming Fundamentals (CMP-2122) Maximum Marks: 60
Discussion
Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.
No questions yet — be the first to ask.
More Programming Fundamentals papers
See all
Programming Fundamentals (CMPC-5201) I.T/CS/SE University of Sargodha - ADP/BS 1' Semester Examination 2025
Uploaded 8 months ago
Download ↓
Subject: I.T/CS/SE Time Allowed: 02:30 Hours University of Sargodha ADP/BS 1º Semester Examination 2025
Uploaded 9 months ago
Download ↓
Programming Fundamental (CMPC-102) UOS ADP-IT 2024 Paper 2nd Semester
Uploaded 1 year ago
Download ↓
Bs-IT-Cs-SE-Programming-Fundamentals University Of Sargodha -2024.
Uploaded 1 year ago
Download ↓
Programming-Fundamentals-Msc-IT UOS 2017.
Uploaded 1 year ago
Download ↓
BS-IT-CS-SE-Programming-Fundamentals UOS ( University Of Sargodha) -2023
Uploaded 1 year ago
Download ↓
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