Statement Operators in Chsarp
Statement Operators in Chsarp
EXPRESSIONS AND
OPERATORS IN C#
STATEMENTS
• Statements help you build a logical flow in the program. With the
help of statements, you can:
• Initialize variables and objects
• Take the input
• Call a method of a class
• Display the output
TYPES OF STATEMENTS
• Similar to statements in C and C++, the C# statements are
• classified into seven categories:
• Selection Statements
• Iteration Statements
• Jump Statements
• Exception Handling Statements
EXPRESSIONS
•+
•-
•/
•*
•%
ARITHMETIC OPERATORS
RELATIONAL OR COMPARISON
OPERATORS
• Relational operators make a comparison between two operands
and return a boolean value, true, or false.
• ==
• !=
• >
• <
• >=
• <=
LOGICAL OR CONDITIONAL
OPERATORS
• Assignment operators are used to assign the value of the right side
operand to the operand on the left side using the equal to operator (=).
• The assignment operators are divided into two categories in C#. These
are as follows:
• Simple assignment operators: The simple assignment operator is =,
which is used to assign a value or result of an expression to a variable.
• Compound assignment operators: The compound assignment
operators are formed by combining the simple assignment operator with
the arithmetic operators.
ASSIGNMENT OPERATORS