munotes® Sign in

Engineering Sem 2 C Programming Mar 2022 - Online Question Paper with Solutions

Mumbai University Solved Question Papers munotes.in

C Programming

Engineering · Sem 2

Mar 2022 - Online Examination

Previous Year Question Paper with Solution

munotes.in Mumbai

munotes.in

First published on munotes.in on 2 December 2026.

This edition revised 3 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 Mar 2022 - Online examination.

munotes.in ii
munotes.in iii
munotes.in iv
munotes.in v
munotes.in vi

The Paper as Set

The questions in this volume are the questions asked at the Mar 2022 - Online 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.

24 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 vii

Q1

Q1

Choose the correct option for the following questions. All the Questions are compulsory and carry equal marks; 2 marks each · 20 Marks

munotes.in 1

1.Which of the following is an exit-controlled loop? Option A: For. Option B: While. Option C: Do- while. Option D: Switch.[2]

Answer

For full marks, cover: what makes a loop exit-controlled, the correct option, why the other three are not, and a short program that shows the difference.

Answer: Option C, Do- while.

Why

A loop is exit-controlled when its test comes after the body. The do-while loop runs its body first and then tests the condition. So its body always runs at least once. The for loop and the while loop test before the body, so they are entry-controlled.

The other options

  1. Option A, For: the condition is tested before each pass, so it is entry-controlled.
  2. Option B, While: the same, and its body runs zero times when the test is false at once.
  3. Option D, Switch: it picks one case by a value. It is a selection statement, not a loop.
munotes.in 2

Program in C

#include <stdio.h>

int main(void)

{

int n = 10;

while (n < 5) {

printf("while: body ran with n = %d\n", n);

n++;

}

printf("while: the test n < 5 was false at once, so the body never ran\n");

do {

printf("do-while: body ran with n = %d\n", n);

n++;

} while (n < 5);

printf("do-while: the test came after the body, so it ran once\n");

return 0;

}

munotes.in 3

Output

while: the test n < 5 was false at once, so the body never ran

do-while: body ran with n = 10

do-while: the test came after the body, so it ran once

With n = 10 the test n < 5 is false from the start. The while body never ran, but the do-while body ran once before its test.

Conclusion. The do-while loop tests its condition after the body, so it is the exit-controlled loop. The answer is option C, Do- while.

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!