LogIn
I don't have account.
Q1.
What will be the output of the following code?
int a = 5, b = 2;
Console.WriteLine(a / b);
1
1
2.5
2
2
3
3
4
Error
Q2.
Which operator has the highest precedence in C#?
1
1
+
2
()
3
=
4
*
Q3.
What does the ?? operator do in C#?
1
1
Checks equality
2
Performs null-coalescing
3
Checks type
4
Performs bitwise OR
Q4.
What is the result of this expression: true || false && false?
1
1
false
2
true
3
Error
4
Cannot determine
Q5.
Which of the following is a valid assignment in C#?
1
1
int a = 10 + "20";
2
int a = 10 * true;
3
int a = 10 / 0;
4
double a = 10 / 3;
Q6.
What will be the output of the following code?
int a = 10;
a += 5;
Console.WriteLine(a);
1
1
10
2
15
3
5
4
Error
Q7.
Which of the following is not a relational operator in C#?
1
1
<=
2
<>
3
==
4
!=
Q8.
What is the result of 5 % 2?
1
1
2.5
2
1
3
Error
4
2
Q9.
Which operator is used for conditional evaluation in C#?
1
1
&&
2
?:
3
==
4
??
Q10.
What is the value of !(true && false)?
1
1
false
2
true
3
0
4
1
Q11.
Which operator is right-associative in C#?
1
1
+
2
/
3
=
4
*
Q12.
What is the result of 10 & 7 in binary?
1
1
10
2
2
3
7
4
1
Q13.
What will int result = 3 << 2; give?
1
1
6
2
12
3
9
4
0
Q14.
The is operator is used to
1
1
Compare references
2
Check type compatibility
3
Compare values
4
Perform casting
Q15.
What will be the output of the following code?
int a = 5;
int b = a++;
Console.WriteLine(b);
1
1
6
2
5
3
Error
4
Undefined
Q16.
What will be the output of true ^ false?
1
1
false
2
true
3
Cannot determine
4
Error
Q17.
Which operator cannot be overloaded in C#?
1
1
+
2
&&
3
=
4
.
Q18.
What is the type of result in: int a = 5; double b = 2.0; var c = a / b;?
1
1
double
2
int
3
float
4
decimal
Q19.
What does ~ operator do?
1
1
Bitwise NOT
2
Bitwise XOR
3
Negates a number
4
Inverts boolean
Q20.
What will 10 > 5 ? 1 : 0 return?
1
1
1
2
0
3
true
4
false