C examples for Operator:Arithmetic Operator
An arithmetic statement is of the following form:
variable_name = arithmetic_expression;
The following table lists the Basic Arithmetic Operators.
Operator | Action |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Modulus |
#include <stdio.h> int main(void){ int total = 5;/* ww w.j av a 2s.co m*/ int eaten = 2; total = total - eaten; printf("%d eaten %d total", eaten, total); return 0; }