C Programming/Operators

From Wikiversity
< C Programming(Redirected from C/Operators)
Jump to navigation Jump to search

Objective[edit]

Books-aj.svg aj ashton 01f.png
  • Learn about the range of operators that C provides:
    • Unary Operators
    • Binary Operators
    • Mathematical Operaters
    • Logical Operators

Lesson[edit]

Unary operators[edit]

  • ++ – 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 operators[edit]

  • + – 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.

Assignments[edit]

Crystal Clear app kedit.svg