Which of the following statements is correct about the C#.NET code snippet given below?
A -
Compiler will report an error in case ls > 20 as well as in case Else.
B -
There is no error in this switch case statement.
C -
Compiler will report an error only in case Else.
D -
Compiler will report an error as there is no default case.
2-
Which of the following is another way to rewrite the code snippet given below?
A -
int a = 1, b = 2, c = 0; c = a < b ? a : 0;
B -
int a = 1, b = 2, c = 0; a < b ? c = a : c = 0;
C -
int a = 1, b = 2, c = 0; a < b ? c = a : c = 0 ? 0 : 0;
D -
int a = 1, b = 2, c = 0; a < b ? return (c): return (0);
3-
Which of the following statements are correct?
1/ The switch statement is a control statement that handles multiple selections and enumerations by passing control to one of the case statements within its body.
2/ The goto statement passes control to the next iteration of the enclosing iteration statement in which it appears.
3/ Branching is performed using jump statements which cause an immediate transfer of the program control.
4/ A common use of continue is to transfer control to a specific switch-case label or the default label in a switch statement.
5/ The do statement executes a statement or a block of statements enclosed in {} repeatedly until a specified expression evaluates to false.
A -
1, 3, 5
B -
2, 3, 4
C -
3, 4, 5
D -
None of these
4-
Which of the following statements are correct about the C#.NET code snippet given below?
1/The condition no < 11 will get evaluated only if age > 18 evaluates to False.
2/ The condition no < 11 will get evaluated if age > 18 evaluates to True.
3/ The statement a = 25 will get evaluated if any one one of the two conditions is True.
4/ || is known as a short circuiting logical operator.
5/ The statement a = 25 will get evaluated only if both the conditions are True.
A -
2, 4
B -
1, 3, 4
C -
2, 3, 5
D -
None of these
5-
What will be the output of the code snippet given below?
A -
1 2 3 4 5 6 7 8 9 10
B -
1 2 3 4
C -
0 1 2 3 4 5 6 7 8 9 10
D -
4 5 6 7 8 9 10
6-
Which of the following loop correctly prints the elements of the array?
A -
B -
C -
D -
7-
Which of the following statements is correct about the C#.NET code snippet given below?
A -
The compiler will report case i and case j as errors since variables cannot be used in cases.
B -
Compiler will report an error since there is no default case in the switch case statement.
C -
The code snippet prints the result as "I am in Case i"".
D -
The code snippet prints the result as "I am in Case j".
8-
Which of the following are the correct ways to increment the value of variable a by 1?
1/ ++a++;
2/ a += 1;
3/ a ++ 1;
4/ a = a +1;
5/ a = +1;
A -
1, 3
B -
2, 4
C -
3, 5
D -
4, 5
9-
What will be the output of the C#.NET code snippet given below?
A -
163 92
B -
92 163
C -
192 63
D -
0 1
10-
Which of the following is NOT an Arithmetic operator in C#.NET?