Arithmetic Operators in C — a practical guide to C arithmetic operators with clear examples you can reuse in real projects.
C Programming Tutorial Series (20/102). Prefer one article? Read the complete C programming tutorial.
Short description
Integer division truncates; watch divide-by-zero.
Arithmetic
int a = 10, b = 3;
int q = a / b; /* 3 */
int r = a % b; /* 1 */