Operators
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 of the following is a compound assignment operator?
A
=+
B
+=
C
==
D
!=
Note:
Compound assignment operators perform an operation and assignment in one step.
Show answer
Show Note
Report
Question:
What does the << operator do?
A
Performs bitwise left shift
B
Performs bitwise right shift
C
None
D
Both
Note:
The << operator shifts bits to the left, effectively multiplying the number.
Show answer
Show Note
Report
Question:
What is the output of 0 | 1?
A
1
B
0
C
2
D
3
Note:
The bitwise OR operation results in 1 (binary 00 | 01 = 01).
Show answer
Show Note
Report
Question:
What does 5 > 3 && 2 < 4 evaluate to?
A
true
B
false
C
null
D
error
Note:
Both conditions are true, making the result true.
Show answer
Show Note
Report
Question:
Which operator checks if two operands are not equal?
A
!=
B
==
C
=!=
D
<>
Note:
The != operator checks for inequality.
Show answer
Show Note
Report
Question:
What does b >>= 1 do?
A
Divides b by 2 and assigns the result to b
B
Multiplies b by 2 and assigns the result to b
C
None
D
Both
Note:
The right shift operator divides the value by 2 for each shift.
Show answer
Show Note
Report
Question:
What is the result of 3 + 4 * 2?
A
14
B
10
C
11
D
9
Note:
The multiplication operator has higher precedence than addition.
Show answer
Show Note
Report
Question:
What does a |= b do?
A
Adds b to a
B
Performs bitwise OR and assigns the result to a
C
Sets a to b
D
None
Note:
This is a compound assignment operator that combines bitwise OR with assignment.
Show answer
Show Note
Report
Question:
What will 3 | 1 evaluate to?
A
1
B
2
C
3
D
4
Note:
The bitwise OR results in 3 (binary 11 | 01 = 11).
Show answer
Show Note
Report
Question:
What does the ^ operator do?
A
Bitwise OR
B
Bitwise XOR
C
Logical AND
D
None
Note:
The ^ operator returns 1 for differing bits.
Show answer
Show Note
Report
First
Prev
3
4
5
6
Next
Last
/6
Go
Schools
App Store
Whiteboard
Blogs
Quiz
Test
Apply Course
Games
Freelancers
Professionals
Newspapers
Terms
Privacy
Copyright © 2024. Powered by
Intellect Software Ltd