Building Expressions Using Operators

Learn how about arithmetic, relational and equality operators and how they can be used for building C expressions.

Like in any other programming language, in C, there are many arithmetic, relational, and logical operators that can be used to create expressions that are made up of simpler basic types and constants. A C expression always evaluates to some value.

Arithmetic operators

The following binary arithmetic operators can be used in C: +, -, *, / and %. The first four of these are for addition, subtraction, multiplication and division. The last one (%) is the modulo operator which applied to two values computes the remainder from dividing the first operand by the second operand:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy