Prog Exam 2022
Prog Exam 2022
ine(s).
segment 2. The output will
cont d)
6.
In code segment 2, the output wi be
- d) 5
b) 6 c) ecuted time(s)
code
segment 2, the body of the loop w d) 5
1
8 In code
segment 2, if we remove the r d continue, the output will be
a)o key d) 15
b)6
in code segment 2, if connue with break, the body of the loop will be executed
we replace the keywor
times.
3 d)5
C)
10. In code segment 2, if we
replace the ord connue with break, the output will be
keyw
bi6 c) 9 15
n the given code
segment 4, the output of execung une w20, will be
b) 3 c) 4
in the d) other
12. given code segment 4,
the output of execuing line will be
) 2 *19,
T . I n the
b)3 c)4 d other
given code segment 4, the output of
) executing line #18, will be
14. In the
b) 3 4 other
given code segment 4, the
2 output of executing line
#17, will be
b) 3 c)4
15. In the given code segment 4, the ) other
output of executing line #16, will be
-
) 3
c)4 di other
In the
16. given code segment 3, the statement
1 #6 will be executed -time(s).
b 5
c) 10
17. In the
given code segment 3, the statement #10 will
15
3) 1 be executed
10 ACuted time(s).
18. In the given code segment 3, the statement #12
will be executed 15
) 5 C) 10
time(s).
19. In the d)115
given code segment 3, the statement #14 will be executed
a) 1
b)5
time(s).
) 10
20. In the
given code segment 3, if we remove the 15
lines (line#5, line#6, and line#7), the statement #10
be executed time(s). wi
a)
b 5 10
15
Answer Al the follow ing Questons
of the follok
lowing alement
stalemenis is True ale
Marks: State whether each
or
Question |1| 30
ollshed implernentai
implernertatin
at he
* *
2. In d) Case2 Case1
C) Case1 Case2
a) Case2 Case
3. In code segment 1, if we remove the line #5, The output will De- d) No output
a) Case1 ) Case2 gError
4. In code segment 1, if we remove the line #6, The output wl
d) No output
c) Error
a) Case1 b) Case2
Line ICode segment 3
Main (0
static void
for(int a =1; a <=S, a**)
ntb 1
while(b <={a))
ystem.Console.Writel
1, b+ / / End While
intc
dot "*");
ystem.console.Writel
loop
}whilelc <= a);// Ena ao.While
C*;
System.Console. Writeline( ):
12
13 }W/ End for loop
System.Console.Write("Shape of Stars"
14
15 W/End Main method
ICode segment 4
Line
(int x, int y{
static int funl
etuin (x-v
result " X,
13 System.Console.WriteLine(result);
16 //System.Console.Writeline(fun1(3.2,2
17 System.Console. WriteLinefun1(3,1
8 System.Console. Writeline( fun2(4,
19 5ystem.Console. Writeline(fun2(3,4)
20 fun3(2)
1