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:
What is the output of 5 != 5?
A
true
B
false
C
null
D
error
Note:
The != operator checks if two values are not equal; here they are equal.
Show answer
Show Note
Report
Question:
What does a++ do?
A
Increments a by 1 and returns the old value
B
Increments a by 1 and returns the new value
C
Decreases a by 1
D
None
Note:
The ++ operator can be used as a postfix operator to return the original value before increment.
Show answer
Show Note
Report
Question:
What will 3 | 2 evaluate to?
A
1
B
2
C
3
D
5
Note:
The bitwise OR results in 5 (binary 11 | 10 = 11).
Show answer
Show Note
Report
Question:
What does the operator >> do in C#?
A
Performs bitwise left shift
B
Performs bitwise right shift
C
Both
D
None
Note:
The >> operator shifts bits to the right, effectively dividing the number by 2 for each shift.
Show answer
Show Note
Report
Question:
Which operator is used to perform a conditional check?
A
? :
B
&&
C
||
D
==
Note:
The ternary operator ? : performs a conditional check and returns one of two values based on the condition.
Show answer
Show Note
Report
Question:
What does a /= b do?
A
Divides a by b and assigns the result to a
B
Multiplies a by b and assigns the result to a
C
None
D
Both
Note:
This is a compound assignment operator.
Show answer
Show Note
Report
Question:
What is the output of 1 + 2 * 3?
A
9
B
7
C
6
D
5
Note:
The multiplication operator has higher precedence than addition.
Show answer
Show Note
Report
Question:
Which operator checks for null?
A
is
B
as
C
??
D
All
Note:
is can check for null, and ?? provides a default value if null.
Show answer
Show Note
Report
Question:
What is the result of 4 << 1?
A
2
B
4
C
8
D
16
Note:
The left shift operator shifts the bits to the left, multiplying by 2 for
Show answer
Show Note
Report
Question:
What does a += b do?
A
Subtracts b from a
B
Multiplies a by b
C
Adds b to a
D
None
Note:
This is a compound assignment operator that combines addition and assignment.
Show answer
Show Note
Report
First
Prev
1
2
3
4
5
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