Home /Programming Fundamentals

Programming Fundamentals BS 1 Semester/Term 2016

Programming Fundamentals BS 1 Semester/Term 2016 — 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.

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
  • Ayesha Mustafa· 1 day ago

    BS ZOOLOGY first semester Animal diversity ZOOL 101 - university of Punjab 2025

    0 replies Reply →
  • Abubakar· 1 day ago

    Literary criticism

    1 reply Reply →
  • Guest· 2 days ago

    this paper consists of 60 marks but now we have 35 marks paper.

    1 reply Reply →
  • Annie· 2 days ago

    Can you please tell me more past papers please because my exams are starting from next week

    1 reply Reply →
  • Ahmed· 6 days ago

    Did you provide the past papers of the science of society uos?

    1 reply Reply →

More Programming Fundamentals papers

See all

Paper text

BS 1" Term Examination 2016

Paper: Programming Fundamentals (CMP-2122)

Subject: I. T

Time Allowed: 2:30 Hours

Maximum Marks: 6

Objective Part Compulsory (12*2=24)

Note: Attempt all questions. All question 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?

What is the scope of Local Variable?

What is meant by Case Sensitivity in C language?

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?

4

4

4

3

3 -

2

QS.

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 display 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.