munotes® Sign in

Engineering Sem 2 C Programming May 2016 Question Paper with Solutions

Mumbai University Solved Question Papers munotes.in

C Programming

Engineering · Sem 2

May 2016 Examination

Previous Year Question Paper with Solution

munotes.in Mumbai

munotes.in

First published on munotes.in on 2 December 2026.

Published by munotes.in, Mumbai.

Model answers written and edited by the munotes.in editorial desk.

Passages from this volume may be quoted, in print, online or by an AI system, with credit: name munotes.in and link to this volume's page. The volume may not be reproduced as a whole. Full terms at munotes.in/content-license.

munotes.in is an independent study resource for students of the University of Mumbai. It is not affiliated with the University of Mumbai, and is not endorsed by it.

The University does not publish an official answer key for this paper. The answers in this volume are model answers, written to show how a full-mark answer is built. They are a study aid, not an authority on what an examiner marked.

The question paper reproduced here is the paper as set by the University of Mumbai at the May 2016 examination.

munotes.in ii
munotes.in iii
munotes.in iv

The Paper as Set

The questions in this volume are the questions asked at the May 2016 examination, reproduced as the University of Mumbai set them, in the order it set them. Nothing has been reworded, added or left out. Only the answers are ours. See the original question paper.

Duration 3 hours  ·  Total marks 80  ·  15 questions answered

How to use this volume

Solve the paper first, under exam conditions and against the clock. Then read the answers here and mark your own. Reading a solution before attempting the question feels productive and teaches very little, because recognising an answer is not the same as being able to write one.

munotes.in v

Q1

Q1 20 Marks

munotes.in 1

(a)What do you mean by algorithm? Which points you should consider while developing the algorithm.[4]

Answer

For full marks, cover: the meaning of an algorithm, its five properties, the points to keep in mind while developing one, and a short algorithm as an example with a dry run.

Algorithm

An algorithm is a finite sequence of clear, step-by-step instructions that solves a given problem: it starts from the given input and, after a finite number of steps, produces the required output. It is written in plain language or pseudocode, before the program, and does not depend on any programming language. The word comes from the name of the ninth-century mathematician al-Khwarizmi.

Properties

  1. Input: zero or more quantities are supplied from outside.
  2. Output: at least one result is produced.
  3. Definiteness: every step is clear and has only one meaning.
munotes.in 2
  1. Finiteness: the algorithm ends after a finite number of steps.
  2. Effectiveness: every step is simple enough to be carried out exactly, in a finite time, with pencil and paper.

Points to consider while developing an algorithm

  1. Understand the problem fully: what is given, what is wanted, and the conditions (the problem definition).
  2. Name the inputs and the outputs, with their types and ranges.
  3. Break the work into small steps in the right order, and number them.
  4. Make every step definite, so that no step leaves a choice to the reader.
  5. Cover every case, including the unusual ones: zero, negative values, equal values and empty input.
  6. Make sure every loop ends, so that the algorithm terminates.
  7. Prefer the method with fewer steps and less memory (efficiency).
  8. Check it by a dry run with sample data whose answer is known.
munotes.in 3

Example: the largest of three numbers

  1. Step 1: Start.
  2. Step 2: Read A, B and C.
  3. Step 3: Set MAX = A.
  4. Step 4: If B > MAX, set MAX = B.
  5. Step 5: If C > MAX, set MAX = C.
  6. Step 6: Print MAX.
  7. Step 7: Stop.

Dry run with A = 12, B = 45 and C = 30: MAX becomes 12, then 45; 30 is not greater than 45, so 45 is printed.

Conclusion. An algorithm is a finite, ordered set of definite and effective steps that turns the input into the output. While developing one, define the problem, fix the inputs and outputs, order the steps, cover every case, make sure it ends, keep it efficient and test it with a dry run.

munotes.in 4

This paper is locked

Get the solved papers to read this paper and every solved paper of this semester.

B.E. First Year (all branches) Semester 2 Previous Year Question Paper Solutions
B.E. First Year (all branches) Semester 2 Notes
Issue

Found an error in this volume? Report it and we will check it against the paper.

Done!