Programming Fundamentals ADP 2 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 BS 1 Semester/Term UOS — University of Sargodha 2023
Uploaded 1 month ago
Download ↓
Programming Fundamentals (CMPC-5201) I.T/CS/SE University of Sargodha - ADP/BS 1' Semester Examination 2025
Uploaded 11 months ago
Download ↓
Programming Fundamentals ADP/BS 1 Semester/Term PU — University of the Punjab 2025
Uploaded 1 year ago
Download ↓
Programming Fundamentals BS 1 Semester/Term University Of Sargodha (UOS) 2024
Uploaded 2 years ago
Download ↓
Programming Fundamentals MPhil Information Technology/MS Information Technology/MSc Information Technology 1 Semester/Term University Of Sargodha (UOS) 2017
Uploaded 2 years ago
Download ↓
Programming Fundamentals BS/MS Software Engineering/PhD Software Engineering 1 Semester/Term University Of Sargodha (UOS) 2023
Uploaded 2 years ago
Download ↓
Paper text
University of Sargodha
ADP 2nd Term Examination 2024
Paper: Programming Fundamentals (CMPC-102)
(For Regular & Retake Students)
Subject: IT
usta@ni.coff
Time Allowed: 02:30 Hours
Objective part is compulsory. Attempt any three questions from subjective part.
Q.1.
Maximum Marks: 40
Write short answers of the followid in 2-3 lines each on your answer sheet.
What is use of continue statement?
Write name of two right associative operators used in C language.
ii.
iii.
iV.
V.
Evaluate the expression 21 + 8 - 7 * 4 / 6% 3;
Give an example of both implicit and explicit type casting.
Consider following declaration statement.
int *ptr, a = 6;
Is following statements valid? Give reasoning.
pir = a;
vi.
vii.
What is scope and life time of a local variable?
What is the output?
inti, p = 1;
for (i = 2; i <= 6; i = i + 2)
p. *= i;
printi("d", p);
vili.
Declare an int array of size 5 and pointer to int in a single statement.
ustadni.Cöpn
Q.3.
Q.4.
Q.5.
Subjective Part
(3"8)
Write a program that accepts an integer value user and passes it to a function. The function determines
its factors by excluding 1 and itself. The number of factors are displayed by main O
For example: An integer value 15 has factors 1, 3, 5 and 15. The program should consider 2 factors by
leaving 1 and 15.
Write a program that accepts 10 integer values from user in an array and passes array and its size to
a function. The function makes the odd values stored in the array 2-times (i.e. multiply all odd of the
array by 2). The updated array is displayed by main O.
Write a program that accepts an integer value from user and displays whether the number is prime or
composite.
Write a program that displays the following pattern (using the concept of nested loops).
3
2
2
ustadp.
4
5
.com
Q.6.
#include