Home /UOS — University of Sargodha /Programming Fundamentals

Programming Fundamentals ADP 2 Semester/Term University Of Sargodha (UOS) 2024

Programming Fundamentals ADP 2 Semester/Term University Of Sargodha (UOS) 2024 — 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

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