Programming Fundamentals BS 1 Semester/Term UOS — University of Sargodha 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.
Need Paper?
See all →
Need a paper or stuck on a question? Ask here — students reply and you get an email.
Ask about a paper-
BS ZOOLOGY first semester Animal diversity ZOOL 101 - university of Punjab 2025
0 replies Reply → -
Literary criticism
1 reply Reply → -
this paper consists of 60 marks but now we have 35 marks paper.
1 reply Reply → -
Can you please tell me more past papers please because my exams are starting from next week
1 reply Reply → -
Did you provide the past papers of the science of society uos?
1 reply Reply →
More Programming Fundamentals papers
See all
Programming Fundamentals BS 2 Semester/Term PU — University of the Punjab 2020
Uploaded 10 hours ago · by Nargis
Download ↓
Programming Fundamentals ADP/BS 1 Semester/Term UOS — University of Sargodha 2025
Uploaded 10 hours ago · by Nargis
Download ↓
Programming Fundamentals AD/BS 2 Semester/Term PU — University of the Punjab 2025
Uploaded 20 hours ago · by Nargis
Download ↓
Programming Fundamentals BS Software Engineering/MPhil Information Technology/MS Information Technology 1 Semester/Term UOS — University of Sargodha 2017
Uploaded 2 days ago · by Hifza
Download ↓
Programming Fundamentals BS 1 Semester/Term 2016
Uploaded 2 days ago · by Hifza
Download ↓
Programming Fundamentals BS/MPhil Computer Science/MS Computer Science 1 Semester/Term UOS — University of Sargodha 2016
Uploaded 2 days ago · by Hifza
Download ↓
Paper text
University of Sargodha
BS 1a Term Examination 2024
Paper: Programming Fundamentals (CMPC-101)
Subject: I.T/CS/SE
Time Allowed: 02:30 Hours
Maximum Marks: 40
Note: Objective part is compulsory, Attempt any three questions from subjective part.
Objective Part
(Compulsory)
Q.1. Write short answers of the following in 2-3 lines of each on your answer sheet.
(2*8)
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 language? How many operands does it take?
Is the following statement valid or invalid? Give reason whatever the case may be?
int abc_ed = 6 ;
w. What does the following code display?
int a = 3, b= 2, c= 2;
if ((a - c) > 10 || (c < a - 3))
printf("%din", a + c);
else
printi("%din", b - a);
vii.
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
vili.
your answer.
What will be displayed?
int *p, var = 4;
p = &var;
*p = *p-2;
print/("%dUn", var);
Subjective Part
(3*8)
Q.z.
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 main).
For example: 12 has factors 1, 2, 3, 4, 6, and 12. The sum of factors less than half of 12 are
1+2+3+4=10.
Q.3. 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 main).
For Example: if accepted string is Fortune Teller, then number of characters are 14.
Q.4. Write a program that displays a lower half of diamond.
Q.5.
Q.6.
Write only the output of the following program in its correct format.
int i,j = 9,k=2;
for (i=3;i