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 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
Question:
Which operator is used for string concatenation?
A
+
B
&
C
|
D
None
Note:
The + operator is used to concatenate strings in C#.
Show answer
Show Note
Report
Question:
What will the expression 5 > 2 && 3 > 1 evaluate to?
A
true
B
false
C
null
D
error
Note:
Both conditions are true, so the logical AND returns true.
Show answer
Show Note
Report
Question:
What is the output of !(2 == 2)?
A
true
B
false
C
null
D
Error
Note:
The expression evaluates to true, and negating it gives false.
Show answer
Show Note
Report
Question:
Which operator is used to perform a bitwise negation?
A
!
B
~
C
^
D
None
Note:
The ~ operator inverts all bits of the operand.
Show answer
Show Note
Report
Question:
What does the => operator signify in C#?
A
Return statement
B
Lambda expression
C
Ternary operation
D
None
Note:
The => operator is used in defining lambda expressions.
Show answer
Show Note
Report
Question:
What will the expression false || true evaluate to?
A
true
B
false
C
null
D
error
Note:
The logical OR evaluates to true if at least one operand is true.
Show answer
Show Note
Report
Question:
Which of the following is NOT a bitwise operator?
A
&
B
+
C
|
D
^
Note:
The + operator performs arithmetic addition, not bitwise operation.
Show answer
Show Note
Report
First
Prev
1
2
3
4
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