Operators - Data types and structures - Edexcel - GCSE Computer Science Revision - Edexcel - BBC Bitesize (2024)

In computer science, an operator is a character or characters that determine the action that is to be performed or considered.

There are three types of operator that programmers use:

  • arithmetic operators
  • relational operators
  • logical operators

These operators are common to most high-level programming languages.

Arithmetic operators

Computers are designed to carry out calculations. Arithmetic operators allow arithmetic to be performed on values.

Arithmetic operationOperatorExample
Addition+x = x + 5
Subtraction-x = x - 5
Multiplication*x = x * 5
Division/x = x / 5
Integer divisionDIVx = x DIV 5
RemainderMODx = x MOD 5

Relational operators

Relational operators allow for assignment and enable comparisons to be made. They are used in condition testing.

Relational operationOperatorExample
Assignment=x = 5
Equivalence= or ==if x = 5 or if x == 5
Less than<if x < 5
Less than or equal to<=if x <= 5
Greater than>if x > 5
Greater than or equal to>=if x >= 5
Does not equal<> or !=If x <> 5 or if x != 5

Logical operators

Logical operators are used to combine relational operators to give more complex decisions.

Logical operationOperatorExample
AndANDif x > 0 AND x < 10
OrORif topic == "Computing" OR topic == "Computer Science"
NotNOTwhile NOT x
Operators - Data types and structures - Edexcel - GCSE Computer Science Revision - Edexcel - BBC Bitesize (2024)
Top Articles
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 5466

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.