TotalNo. ofPages: 1 No...
Roll
FIRSTSEMESTER B.Tech.
MID SEMESTER EXAMINATION MAR-2023
Programming forProblem Solving
Time:2:00Hours Max. Marks:20
Note: QuestionNo. 1is
compulsory.
Attempt Four Questionsinall.
Allquestions
carryequalmarks.
Assume suitable missingdata,ifany.
Q.1(a)Which of the following
symbolsisthe type specifier?
i)& ii)* ii)
# %
iv)
(b)How do you initialize
an arrayin c?
i)int a[3]={1,2,3};ii)
inta(3)={1,2,3};
ii)inta[3]H1,2,3);iv)inta (3)-(1,2,3);
(C) A variable
name inC should be a/an
i)Reserveword ii)
ii)
Keyword ldentifier iv)All
ofthe above
(d)What isthe outputofprogram?
1. 11
#include<studio.
h> #include<stdio.h>
2 intmain() 2 void main()
3 3
i 4 intal
4 int
int i
= 100;
0;
printf(%d",i ==
0);
10
a = 1
while(a<=1)
if(a*2)
else
printf("%d", a++);
printf("%d",
++a)
return0
10
11 printf("%d",
a+1@);
0.2(a)Draw a flowchartto findthe largeroftwo numbers.
(b)Why isproblemsolvingimportantforcomputer programmers?
Q.3(a)Writea program to print
pattern usingforloop
23
4 56
789 10
(b)Writethe difference between break and continuestatementinC.
Writea program to x" usingrecursive function.
calculate
o4
the call valueand call referencewith example inC language.
O5 Differentiate by by