What Is an Operator in Programming?
The symbols that perform math, comparisons, and logic in your code.
What an operator is
In programming, an operator is a symbol that performs an operation on one or more values. The most familiar example is the plus sign, which adds two numbers. Operators are how programs do math, compare values, and combine logical conditions. They are a basic building block of code: almost every program uses operators constantly to calculate, compare, and make decisions. The values an operator works on are called its 'operands.'
Arithmetic operators
Arithmetic operators perform mathematical calculations. These include addition, subtraction, multiplication, and division, using symbols much like the ones you learned in school. There is often an operator for the remainder of a division, too, which is surprisingly useful in programming. Arithmetic operators let programs do everything from adding up a shopping cart total to calculating positions on a screen. They are the most intuitive kind of operator, working just as you would expect from basic math.
Comparison operators
Comparison operators compare two values and produce a true or false result. They check whether values are equal, not equal, greater than, less than, and so on. For example, a program might check whether a user's age is greater than or equal to 18. Comparison operators are essential for decision-making: they produce the true/false conditions that conditional statements rely on to choose what the program should do next.
Logical operators
Logical operators combine or modify true/false values, implementing Boolean logic. The main ones are AND (true only if both sides are true), OR (true if at least one side is true), and NOT (which flips true to false and vice versa). These let programs build complex conditions, such as 'if the user is logged in AND has permission.' Logical operators are the tools for expressing sophisticated decision-making logic in code.
Assignment and others
The assignment operator, usually an equals sign, stores a value in a variable, one of the most common operations in any program. Many languages also offer shortcut operators that combine arithmetic with assignment, like adding to a variable in place. There are other specialized operators too, but arithmetic, comparison, logical, and assignment are the core categories. Together, these handful of symbol types cover the vast majority of what programs need to do with values.
Why it matters
Operators are a fundamental part of programming, the symbols that let code perform math, make comparisons, apply logic, and store values. Understanding the main types, arithmetic, comparison, logical, and assignment, gives you the vocabulary to read and write the expressions that appear in virtually every program. For anyone learning to code, operators are a basic but essential building block you will use in nearly every line you write.
Related on Skillo
See also: What is a conditional statement?, What is Boolean logic? Explained simply.
Sources
Published date reflects the original event date (2024-08-13). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.
Written by
Skillo Staff
0 Comments
Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.