In C programming, arithmetic operators are used to perform basic mathematical operations like addition, subtraction, multiplication, division, and modulus.
Let’s walk through them with clear explanations and real code examples.
What Are Arithmetic Operators in C?
Arithmetic operators work on numeric data types (int, float, double) to perform mathematical operations. These are some of the most frequently used operators in any program.
List of Arithmetic Operators
Operator
Name
Description
Example
Result
+
Addition
Adds two values
5 + 3
8
-
Subtraction
Subtracts right from left
5 - 3
2
*
Multiplication
Multiplies two values
5 * 3
15
/
Division
Divides left by right
5 / 2
2 (int) or 2.5 (float)
%
Modulus
Returns remainder (integers only)
5 % 2
1
Example Program: Arithmetic in C
#include <stdio.h>
int main() {
int a = 10, b = 3;
printf("Addition: %d + %d = %d\n", a, b, a + b);
printf("Subtraction: %d - %d = %d\n", a, b, a - b);
printf("Multiplication: %d * %d = %d\n", a, b, a * b);
printf("Division: %d / %d = %d\n", a, b, a / b);
printf("Modulus: %d %% %d = %d\n", a, b, a % b);
return 0;
}