Operators
Operators are symbols or keywords that tell the computer what operations to do on values or variables.
What is an Operator?
An operator is a symbol or keyword that tells the computer what operation it should perform on values or variables.
In the example below, the +
operator is used to add the numbers 10
and 5
together:
print(10 + 5)
console.log(10 + 5);
System.out.println(10 + 5);
cout << 10 + 5;
Run Example »
For more details on language-specific operators, check out Python Operators, JavaScript Operators, Java Operators, and C++ Operators.
Types of Operators
There are many types of operators, but the most common ones are:
- Arithmetic operators (+, -, etc.)
- Assignment operators (=, +=, -=, etc.)
- Comparison operators (==, >, <, etc.)
- Logical operators (&&, ||, etc.)
- Bitwise operators (&, |, etc.)
Visit the pages linked to above for more details on each type of operator.