Home /UOS — University of Sargodha /Main Campus /Programming Fundamentals

Programming Fundamentals M.Sc. 1st Term 1 Semester/Term UOS — University of Sargodha 2019

Programming Fundamentals M.Sc. 1st Term 1 Semester/Term UOS — University of Sargodha 2019 — 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

University of Sargodha

Subject: I.T

Time Allowed: 2:30 Hours

M.Se. 1" Term Examinution 2019

Paper: Programming Fundamentals (CMP-2122)

Maximum Marks: 80

Note: Objective part is compulsory. Attempt any three questions from subjective part.

Q. 1.

Objective Part

(Compulsory)

Write short answers of the following in 2-3 lines each on vour answer sheet.

(16°2)

• Differentiate between assembly languages and high-level languages.

ji. • Define structured programming languages.

i • Define algorithms.

• List the sub processes involved in program development.

* Discuss at least four data types of C/C++ with examples.

VL - Discuss input and output commands of C/C++ with examples.

Yii * Discuss at least three selection control structures with examples.

_ Differentiate between while and do-while loops.

• What does break statement do? Explain it with an example.

• What does continue statement do? Explain it with an example.

What are the different types of user defined functions available in C/C++?

Differentiate between one-dimensional and two-dimensional arrays with example.

Nu • What are pointers in C/C++? Explain it with example.

Xiv.. What are records do in C/C++? Provide example.

٧٧٠

How the files can be-handled in C/C++? Discuss some file operations.

XVI.

What do you know about testing and debugging?

Subjective Part

(3°16)

Q.2.

Given a string as displayed in Input below, find the number of alphabetic letters and number of

decimal digits in that string as displayed in the output:

Input: 12abc 12

Output: Alphabetic letters = 3, Decimal_digits = 4

Q.3.

Given an array of positive integers. All numbers occur even number of times except onc

number, which occurs odd number of times. Find the number in On) time & constant space.

For example if input array is arr = {1, 2, 3, 2, 3, 1,

3) then output would be

3.

Q.4.

Write a program to print all the LEADERS in the array. An element is leader if it is greater than

all the elements to its right side. And the rightmost element is always a leader. For example in

the array {16, 17, 4, 3, 5, 2}, leaders are 17, 5 and

2.

Q.5.

Given a string, count number of words in it. Following characters separates the words: space

(' ') or new line ('In') or tab ("It') or a combination of these.

Q. 6.

Write a Program to find area of a triangle. For example if input would be a = 5, b = 7, c = 8

then output would be area of a triangle as 17.320508. Area of a triangle can simply be

evaluated using following formula as Area = sqrts* (s-a)*(s-b)"(S:c)) where a, b and c arc

lengths of sides of triangle and s = (a+b+c)/2.