Mumbai University Solved Question Papers munotes.in
Programming with C
BSc IT · Sem I
Nov 2024 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
Mumbai University Solved Question Papers munotes.in
Programming with C
BSc IT · Sem I
Nov 2024 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
First published on munotes.in on 12 November 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 Nov 2024 examination.
The questions below are the paper as the University of Mumbai set it at the Nov 2024 examination, in the order it was set.
MarksPage
The questions in this volume are the questions asked at the Nov 2024 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 1 hours · Total marks 30 · 8 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.
Q1)
Attempt any TWO · 15 Marks
Answer
For full marks, cover: the syntax, the steps by which the loop runs, the three things every loop needs, that the body may run zero times, an example with a trace table, a second example with output, the infinite loop and how it happens, and how while differs from for and do-while.
A while loop repeats a statement as long as a condition is true. It is an entry-controlled loop: the condition is tested before each pass. It suits a loop whose number of passes is not known in advance.
while (condition)
statement
If the body has more than one statement, it is written as a block in braces.
int n = 4721;.n > 0.n = n / 10;.A loop that never ends is always missing the third.
#include <stdio.h>
int main(void) {
int n = 4721;
int sum = 0;
while (n > 0) {
sum = sum + n % 10;
n = n / 10;
}
printf("sum of the digits of 4721 = %d\n", sum);
int count = 5;
while (count >= 1) {
printf("%d...\n", count);
count--;
}
printf("Go! count is now %d\n", count);
return 0;
}
Output:
sum of the digits of 4721 = 14
5...
4...
3...
2...
1...
Go! count is now 0
| n before the test | n > 0? | n % 10 | sum after the body | n after the body |
|---|---|---|---|---|
| 4721 | true | 1 | 1 | 472 |
| 472 | true | 2 | 3 | 47 |
| 47 | true | 7 | 10 | 4 |
| 4 | true | 4 | 14 | 0 |
| 0 | false | none | loop ends | none |
n % 10 takes off the last digit and n / 10 removes it. The loop runs 4 times and tests its condition 5 times. The second loop counts down and stops when count reaches 0.
Because the condition is tested first, the body may never run. With int n = 0;, the test n > 0 fails at once, and sum stays 0.
If the progress step is missing, the condition never becomes false. For example, while (i <= 5) printf("%d\n", i); with no i++ prints the same number for ever. A semicolon after the brackets, while (i <= 5);, gives an empty body that also never ends.
| Loop | Condition tested | Least number of runs | Best for |
|---|---|---|---|
while | before each pass | 0 | an unknown number of passes |
for | before each pass | 0 | a known number of passes |
do-while | after each pass | 1 | a body that must run once, such as a menu |
Conclusion. A while loop tests its condition before every pass and runs the body only while the condition is true. It needs an initialisation, a condition that can become false and progress in the body. Its body may run zero times, and a missing progress step makes it run for ever.
The rest of the answers
You have read the question paper and its first answer in full. Buy the solved papers once and you can read every answer of every solved paper in this semester.
Notes + practical solutions + solved papers: ₹798 Already bought it? Sign in
Or solved papers only: ₹499
Or notes + practical solutions: ₹499
The question paper itself stays free, and so does the syllabus.
What do you need?
Tap one.
The answers are on this page
You can read the first answer here. The box further down shows how to read all of them.
Read it here, any time
We keep checking and updating our papers and notes, and adding more. A saved copy would be an old version. Reading on munotes.in always gives you the latest one.
I paid, but I can't open it
Please type an email, or a 10-digit phone number.
Done
If we find your payment, we send a link to the email you paid with. Open it to read.
Check your email in 2 minutes. Also check Spam.
No email after 10 minutes?
Something else
Please write a little more, so we can help.
Your email app opens with this. You can add more there. We reply by email.
Found an error in this volume? Report it and we will check it against the paper.