# Basic Math in C

## Basic Math Operators

Math in C looks a lot like the math you use everyday. You can use the operators +, -, * and / to solve math problems. The result of a math equation can be assigned to a variable or passed to a function:

```
int result = (2+4)*3/4;
int age = 22;
printf("Half your age is : %d.\n", age/2);
```

The *Modulo operator* "%" can be used to calculate the Remainder of a division equation.

```
14 / 10 == 1 14 % 10 == 4
24 / 10 == 2 24 % 10 == 4
2764 / 10 == 276 2764 % 10 == 4
```

The *Increment operator* "++" can be used to add one to a variable. The *Decrement operator* "--" is the opposite, it subtracts one from a variable

```
int age = 22;
age++;
age == 23
age--;
age == 22
```