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 !(true && false)?
A
true
B
false
C
null
D
Error
Note:
The expression inside evaluates to false, and negating it results in true.
Show answer
Show Note
Report
Question:
Which operator is used to check for equality?
A
==
B
=
C
=!=
D
===
Note:
The == operator checks if two values are equal.
Show answer
Show Note
Report
Question:
What does the as operator do?
A
Casts an object to a specified type and returns null if the cast fails
B
Checks the type of an object
C
Assigns a value to a variable
D
None
Note:
The as operator is used for safe type casting.
Show answer
Show Note
Report
Question:
Which operator would you use to perform a logical negation?
A
&
B
|
C
!
D
~
Note:
The ! operator negates a boolean value.
Show answer
Show Note
Report
Question:
What does a %= b do?
A
Assigns the remainder of a divided by b to a
B
Subtracts b from a
C
Adds b to a
D
None
Note:
This is a compound assignment operator.
Show answer
Show Note
Report
Question:
What is the output of true && true || false?
A
true
B
false
C
null
D
error
Note:
The logical AND is evaluated first, resulting in true, which then evaluates to true with the OR.
Show answer
Show Note
Report
Question:
Which operator performs a bitwise AND operation?
A
&&
B
&
C
|
D
||
Note:
The & operator performs a bitwise AND operation on two integral types.
Show answer
Show Note
Report
Question:
Which operator is used to perform a ternary conditional operation?
A
&&
B
? :
C
if
D
switch
Note:
The ternary operator allows for shorthand conditional expressions.
Show answer
Show Note
Report
Question:
What does x != y check?
A
If x is less than y
B
If x is greater than y
C
If x is equal to y
D
If x is not equal to y
Note:
!= operator checks for inequality.
Show answer
Show Note
Report
Question:
What is the result of 10 % 3?
A
1
B
2
C
0
D
3
Note:
The modulo operator returns the remainder of the division.
Show answer
Show Note
Report
First
Prev
2
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