C TutorialLesson 11Free preview
C Operators
This lesson is part of C · All levels
Summary
An operator is a symbol that commands a computer to perform a certain operation on a value, ranging from arithmetic (+, -, *, /, %), comparison (==,!=, >, <), to logic (&&, ֹּ,!). C also has assignment operators like = and value adders like +=, as well as increment operators like ++ and decrement -- Priorities determine the evaluation sequence, and parentheses can be used to force the order we want. Understanding the operator correctly makes program expressions accurate.
Key points
- Arithmetic operators: + - * / and % (modulus/residual to)
- The comparison operator yields a value of 1 (true) or 0 (false) in C
- Logic operators && (and), ∫ (or), !not) combine the conditions
- The operator +=, -=, *= is an abbreviation of assignment and operation
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.