Relation Vs Logical Vs Assignment Vs Conditional Operators in C# .NET Framework
Loading
Relation Vs Logical Vs Assignment Vs Conditional Operators in C# .NET Framework
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
sasikala sPosted May 23, 2025, 5:28 AM
1. Relational Operators (Comparison Operators)
Relational operators are used to compare two operands and determine the relationship between them. They always return a boolean value (
trueorfalse).2. Logical Operators
Logical operators are used to combine or modify boolean expressions. They also return a boolean value (
trueorfalse). They are often used inif,while, andforstatements to create complex conditions.3. Assignment Operators
Assignment operators are used to assign a value to a variable. The most basic assignment operator is
=. There are also compound assignment operators that combine an arithmetic or bitwise operation with an assignment.4. Conditional Operator (Ternary Operator)
The conditional operator is a shorthand way to write an
if-elsestatement. It takes three operands: a condition, a value if the condition istrue, and a value if the condition isfalse.