An arithmetic statement is of the following form:

variable_name = arithmetic_expression;

The arithmetic expression on the right of the = operator specifies a calculation using variables or explicit numbers that are combined using arithmetic operators such as addition (+), subtraction (?), multiplication (*), and division (/).

The following code is an arithmetic statement:

total = cats + dogs + bugs + others;

The effect of this statement is to calculate the value of the arithmetic expression to the right of the = and store that value in the variable specified on the left.

The = symbol in C defines an action. It doesn't specify that the two sides are equal.

It assigns the value that results from evaluating the expression on the right to in the variable on the left.

For example:

```
total = total + 2;
total = cats + dogs + bugs + others;
total = total + 2;
printf("The total number of pets is: %d", total);
```

// Simple calculations #include <stdio.h> int main(void) { int total;/*w w w. j ava 2 s. c om*/ int cats = 2; int dogs = 1; int bugs = 1; int others = 5; // Calculate the total number of pets total = cats + dogs + bugs + others; total = total + 2; total = cats + dogs + bugs + others; total = total + 2; printf("We have %d pets in total\n", total); // Output the result return 0; }

- Use Basic Arithmetic Operators and variables
- Use Division And Modulus Operator
- Use Unary Minus Operator
- Variable Types and Typical Value Ranges

- What is the output: Division with Integers?
- What is the output: modulus operator?
- Write program to calculate the result of 4 times 5
- Write program to display the result of adding 456.98 and 213.4
- Write program to output calculation of 456.98 + 213.40 =
- Write program to display the result of multiplying the values 8, 14, and 25
- Write program to get the result of 0+50*1-60-60*0+10
- Write program to calculate on float type value