Programming Fundamentals BS 1 Semester/Term University Of Sargodha (UOS) 2024
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 9 months ago
Download ↓
Programming Fundamentals ADP/BS 1 Semester/Term PU — University of the Punjab 2025
Uploaded 10 months ago
Download ↓
Programming Fundamentals ADP 2 Semester/Term University Of Sargodha (UOS) 2024
Uploaded 1 year ago
Download ↓
Programming Fundamentals MPhil Information Technology/MS Information Technology/MSc Information Technology 1 Semester/Term University Of Sargodha (UOS) 2017
Uploaded 1 year ago
Download ↓
Programming Fundamentals BS/MS Software Engineering/PhD Software Engineering 1 Semester/Term University Of Sargodha (UOS) 2023
Uploaded 1 year ago
Download ↓
Programming Fundamentals BS 1 Semester/Term University Of Sargodha (UOS) 2022
Uploaded 1 year ago
Download ↓
Paper text
University of Sargodha
BS 1" Term Examination 2024
Paper: Programming Fundamentals (CMPC-101)
Maximum Marks: 40
Subject: I.T/CS/SE
Time Allowed: 02:30 Hours
Note: Objective part is compulsory. Attempt any three questions from subjective part.
Objective Part
(Compulsory)
(2*8)
Q.1.
ustadni,
i.
ili
IN.
-Write short answers of the following in 2-3 lines of cach on your answer sheet.
Evaluate the expression 2 - 3 % 5 * 8/2 - 1
What is address of operator? Why is it used?
Write the conditional operator used in C Imoge? How many operands does it take?
Is the following statement vatid orgyal? Give reason whatever the case may be?
int abe_ed - 6:2
v. What does the following cote display?
int a = 3, b - 2, c
-2;
if ((a - c) > 10 || (c < a - 3))
printf("/din", a + c);
ustadni.com
cise
printi?%din", b- a);
vi.
vil.
What is scope and life time of a local variable?
How the constant value 3L is interpreted as float value or double value to the compiler? Justify
your answer.
vili.
What will be displayed?
int *p. var = 4:
p = &var:
*p- *p- 2;
printil din", var):
Q.2.
Q.3.
Q.4.
Subjective Part
(3*8)
Write a program that accepts an integer value from user and passes it to a function that finds the sum
of its factors that are less than half of the number. Result is displayed by mainO.
For example: 12 has factors 1, 2
6, and 12. The sum of factors less than half of 12 are
1 + 2+3 + 4 =10.
Write a program that accepts a string from user and pass it to function. The function finds total number
of characters present in the string (Don't include null terminator). The result is displayed by mainO.
For Example: if accepted string is Fortune Teller, then number of characters are 14
Write a program that displays a lower half of diamond.
.....
Write only the output of the following program in its correct format
ustaditi
int id-59 k = 2;
*3: i