C# TutorialLesson 11Free preview
C# Operators
This lesson is part of C# · All levels
Summary
The C# operator includes arithmetic such as plus, minus, times, divisors, and modulus, then comparisons such as equal to and greater than, as well as logic and, or, and no. The modulus operator produces the remainder of the division so it is useful to check for odd and even numbers. It is also important to distinguish the assignment of one equals sign from the comparison of two equals sign.
Key points
- Arithmetic operators: plus, minus, asterisk, percent for the remainder of the division, and slash for the division.
- The comparison operator like equal to, not equal to, greater, smaller produces a bool.
- The logic operator and, or, do not combine some boolean conditions.
- Dividing two integers gives the integer division a circle down.
- One equals sign assigns a value, two equals sign compares a value.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.