C Programming/Operators

ObjectiveEdit

  • Learn about the range of operators that C provides:
    • Unary Operators
    • Binary Operators
    • Mathematical Operaters
    • Logical Operators

LessonEdit

Unary operatorsEdit

  • ++ – Pre-increment or post-increment operator. Increases a variable's value by 1.
  • -- – Pre-decrement or post-decrement operator. Decreases a variable's value by 1.
  • ! – Negation operator. Arithmetically or logically negates a variable.

Binary operatorsEdit

  • + – Addition operator. Produces the sum of two variables.
  • - – Subtraction operator. Produces the difference of two variables.
  • * – Multiplication operator. Produces the product of two variables.
  • / – Division operator. Produces the quotient of two variables.
  • % – Modulus operator. Produces the remainder of the division of two variables.

AssignmentsEdit