Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
The assignment operator is used to assign a value to a variable. It is represented by the equals sign (=) and it assigns the value on the right side of the equals sign to the variable on the left side.
Related terms
Arithmetic operators: These are operators used for mathematical calculations such as addition (+), subtraction (-), multiplication (*), and division (/).
Comparison operators: These are operators used to compare two values or variables, such as greater than (>), less than (<), equal to (==), not equal to (!=).
Compound assignment operators: These are shorthand versions of assignment operators combined with other arithmetic or bitwise operations, such as +=, -=, *=, /=.