Arithmetic Operators in Solidity Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Arithmetic operators are used to perform arithmetic or mathematical operations. Solidity has the following types of arithmetic operators: Addition: The addition operator takes two operands and results in a sum of these operands. It is denoted by +.Subtraction: The subtraction operator takes two operands and results in a difference between these operands. It is denoted by -.Multiplication: The multiplication operator takes two operands and results in a product of these operands. It is denoted by *.Division: The division operator takes two operands and results in a quotient after the division of these operands. It is denoted by /.Modulus: The modulus operator takes two operands and results in the remainder after the division of these operands. It is denoted by %.Increment: The increment operator takes one operand and increments the operand by one. It is denoted by ++.Decrement: The decrement operator takes one operand and decrements the operand by one. It is denoted --.OperatorDenotationDescriptionAddition+ It results in the sum of two operands.Subtraction- It results in the difference between the two operands.Multiplication* It results in the product of two operands.Division/ It results in the quotient of the division of two operands.Modulus% It results in the remainder of the division of two operands.Increment++ It increments the operand by one.Decrement-- It decrements the operand by one. Below is the Solidity program to implement Arithmetic operators: Solidity // Solidity program to implement // Arithmetic Operators pragma solidity ^0.5.0; // Creating Contract contract Arithmetic { function arithop(uint a, uint b) public pure returns (uint, uint, uint, uint, uint, uint, uint) { // Addition operator uint sum = a + b; // Subtraction Operator uint sub = a - b; // Multiplication Operator uint mul = a * b; // Division Operator uint div = a / b; // Modulus Operator uint mod = a % b; // Increment Operator uint inc = ++a; // Decrement Operator uint dec = --b; return (sum, sub, mul, div, mod, inc, dec); } } Output: Comment More infoAdvertise with us Next Article Arithmetic Operators in Solidity A aayushi2402 Follow Improve Article Tags : Solidity Solidity-Basics Similar Reads Arithmetic Operators in SQL Server Arithmetic operators play a crucial role in performing mathematical calculations within SQL Server. These operators allow you to perform addition, subtraction, multiplication, division, and more on numeric data stored in your database tables. In this article, we'll explore the various arithmetic ope 4 min read Solidity - Assignment Operators Solidity is a high-level, statically-typed programming language for Ethereum smart contracts. Python, JavaScript, and C++ impact it. Solidity has several variable and value assignment operators. Solidity supports the following types of operators: Simple Assignment Operator.Arithmetic Assignment Oper 5 min read Arithmetic Operators in PostgreSQL PostgreSQL is an advanced relational database system that supports both relational (SQL) and non-relational (JSON) queries. It is free and open-source. One of the most fundamental properties of database systems is arithmetical operations, without which a multitude of tasks, from simple arithmetic to 8 min read Bash Script - Arithmetic Operators In this article, we will see arithmetic operators in bash script. Arithmetic operators is used to perform arithmetic operations. Bash script supports 11 arithmetic operators. All the operators with their uses is given below: OperatorNameUseExample+AdditionIt adds two operandsresult= a+b-SubtractionI 3 min read Arithmetic Operators in LISP Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, and division. There are 7 arithmetic operators in LISP that are listed in the below table: OperatorSyntaxDescriptionAddition Operator(+)+ num1 num2Add the two numbersSubtraction Operator(-)- 2 min read Like