C#.NET
Test
Model Test
Ebook
Test on C#.Net framwork 4 Sep 30
CSharp Model Test 1
CSharp Model Test Three
Index
C#.NET Home
Datatype
59
Basic
28
Methods
5
Arrays
3
Object-Oriented Programming
11
Operators
53
Control Structure
18
Schools
Ebook
Question:
Which operator is used to perform a logical AND operation?
A
&
B
&&
C
and
D
||
Note:
The && operator is a short-circuit logical AND that evaluates the second operand only if the first is true.
Show answer
Show Note
Report
Question:
What does the operator | do?
A
Performs logical OR
B
Performs bitwise OR
C
Performs both Logical and bitwise OR
D
None
Note:
The | operator performs a bitwise OR operation on two integral types.
Show answer
Show Note
Report
Question:
What is the output of 3 ^ 2?
A
1
B
5
C
0
D
6
Note:
The ^ operator performs a bitwise XOR operation; hence, 3 ^ 2 results in 1 (binary 11 ^ 10 = 01).
Show answer
Show Note
Report
Question:
What does the ?? operator do?
A
Checks for equality
B
Returns the left operand if not null, otherwise the right operand
C
Performs logical negation
D
None
Note:
The ?? operator is known as the null-coalescing operator.
Show answer
Show Note
Report
Question:
Which operator has the highest precedence in C#?
A
+
B
*
C
/
D
-
Note:
Multiplication and division have higher precedence than addition and subtraction.
Show answer
Show Note
Report
Question:
What is the result of 1 << 3
A
1
B
2
C
8
D
4
Note:
The left shift operator << shifts bits to the left, effectively multiplying the number by 2 for each shift.
Show answer
Show Note
Report
Question:
What is the output of the expression 5 % 2?
A
1
B
2
C
0
D
5
Note:
The modulo operator % returns the remainder of the division.
Show answer
Show Note
Report
Question:
What does !true evaluate to?
A
true
B
false
C
null
D
Error
Note:
The ! operator negates the boolean value.
Show answer
Show Note
Report
Question:
What does a &= b do?
A
Sets a to b
B
Performs bitwise AND and assigns the result to a
C
Adds a and b
D
None
Note:
This is a compound assignment operator.
Show answer
Show Note
Report
Question:
What is the output of 10 / 3?
A
3
B
3.3333
C
4
D
2
Note:
Integer division truncates the decimal part.
Show answer
Show Note
Report
First
Prev
8
9
10
11
12
Next
Last
/18
Go
Schools
App Store
Whiteboard
Blogs
Quiz
Test
Apply Course
Games
Freelancers
Professionals
Newspapers
Terms
Privacy
Copyright © 2025. Powered by
Intellect Software Ltd