Programming Fundamentals, Past Papers

Programming Fundamentals BSIt 1st Term 2016 Past Paper UOS

University of Sargodha BS 1st Term Examination 2016 Programming Fundamentals paper with objective and subjective questions.

Transcript of the Paper

University of Sargodha

BS 1st Term Examination 2016

Subject: I.T
Paper: Programming Fundamentals (CMP-2122)

Time Allowed: 2:30 Hours
Maximum Marks: 60

Objective Part Compulsory (12*2=24)

Note: Attempt all questions. All questions carry equal marks.

  1. Why break statement is used in switch statement?
  2. Why it is important to close a file. How is it closed?
  3. What is the scope of Local Variable?
  4. What is meant by Case Sensitivity in C language?
  5. What is built-in function? Give example.
  6. What is Logical Error and how it can be detected?
  7. What is the purpose of goto statement and why it is not preferable?
  8. Differentiate between function prototype and function definition?
  9. Which function is used to find the length of a string?
  10. Define recursive function?
  11. What is Dangling Memory?
  12. What is the difference between pre-increment and post-increment?

Subjective Part (4*9=36)

Note: Attempt any four questions. All questions carry equal marks.

Q2. Write down a program that reads 10 elements in an array from user. Pass the array to a method that finds and print the largest number of given numbers.

Q3. Write down a program that accepts an integer number from user. Calculate and display its factorial by using a recursive function.

Q4. Write down a C program that prints the following pattern?

Q5.
a) Write down a routine that reads contents of a file and print these contents on screen.
b) Write down a method that swaps two values passed by reference.

Q6. Write a program that declares a structure Book to store bookno(int), name(string) and authorname(string). The program defines an array to store record of five students. It inputs five students and then displays the record of each student.

Q7. Write a function Is Prime that has an input parameter num and returns a value of 1 if it is prime. Otherwise it returns the value of 0.