0% found this document useful (0 votes)
17 views3 pages

Prog Exam 2022

Uploaded by

mohamednazmi67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Prog Exam 2022

Uploaded by

mohamednazmi67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

In code

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
* *

. Writing algorithm sequences


(Pnoudo (Pseudo code) Isis aceomp
aceal units that compriws at
wag
comprise vm
refers to the collection of physica syvem
2 Application software
the
monod tor xec tion
the process of calling
Method invoking represents
seeks to understand the problemo domain and to
dotument the
ruir tdna
4. A software design
do.
that the software must
tha"**onal operator
Assignment operator has lower priority expansion
toread and
most dificut modty
language is the
. Code writfen in mach ine is
caed à keyword
the programmer
7. A variable name that is given by
".
Dy
c o m m e n t statement
in C# should start
A Single line
Daseu on tne value of a Boolean erprssicn
statement for execution
The if statement selects a

declared and initialized In the Same statement


10. A variable must be
implementation version witten by the programmer.
11. A built-n method has
an

the torm and ne structure of the statement.


12. The syntax of the language specifies
and arithmetic operators
ae
ciassified as binary operators.
13. All relational operators
tnat Selects a matched choice from several ones
14. A nested loop is a control structure
evaiua
strueturd te over the control vanable many times until the
15. Switch . . .
case structure is a control u
condition is evaluated false.
is equivalent t o me expression n=lz+((++xVv)Px);
16. The expression n=z+#xlyPX
translates and
executes the instructions line by line and immediately
17. A compiler is a program that
executes them

framework includes both FCL and CLR.


18. .Net
value.
acts on data and often returns
19. A method is a subprogram that
within the block of if structure is known as a local variable
20. Variable that declared

30 Marks: Select the correct ehoice:


Question (2]
output will contain line(s)
1. In code segment 1, The other
b) two c three
one
code segmenti, The output will be
-

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

answer McQ from 11 to


U s e t h i s code segment to

ICode segment 4
Line
(int x, int y{
static int funl

etuin (x-v

static int fun2 (int x, int y)

int result= (x>y)' x: Y


return result;

static voId fun3 (int n}


int result =0;

Tor (x=n; x>=1; X-)

result " X,

13 System.Console.WriteLine(result);

15 static void Main()

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

Use this code segment to answer


MCQ from 16 to

You might also like