Arithmetic Operators in Solidity Last Updated : 28 Apr, 2025 Comments Improve Suggest changes 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 Mathematical Operations in Solidity Solidity is a brand-new programming language created by the Ethereum which is the second-largest market of cryptocurrency by capitalization, released in the year 2015 led by Christian Reitwiessner. Ethereum is a decentralized open-source platform based on blockchain domain, used to run smart contrac 6 min read VBA Arithmetic Operators in Excel Arithmetic Operators are the operators which perform mathematical operation or which perform any operation between two numbers like addition(+), subtraction(-), multiplication(*), division( / ), exponentiation(^), modulus(Mod), Bit-Shift operations. In this article, we will learn about the excel VBA 3 min read SQL Server Arithmetic Operators Microsoft's SQL Server, a capable relational database management system, has a lot of features to deal with data and make manipulations purely. SQL Server, in addition to the many features available to users, has a set of operators for arithmetic which allows users of databases to perform mathematic 3 min read Arithmetic Operations Arithmetic Operations are the basic mathematical operationsâAddition, Subtraction, Multiplication, and Divisionâused for calculations. These operations form the foundation of mathematics and are essential in daily life, such as sharing items, calculating bills, solving time and work problems, and in 9 min read Solidity - Operators In any programming language, operators play a vital role i.e. they create a foundation for the programming. Similarly, the functionality of Solidity is also incomplete without the use of operators. Operators allow users to perform different operations on operands. Solidity supports the following typ 7 min read Like