C# Programming

Arithmetic Operators

C# Programming / Arithmetic Operators

Arithmetic Operators

What Are Arithmetic Operators in C#?

C# arithmetic operators perform mathematical operations such as addition, subtraction, multiplication, division, and modulus between numeric data types. These operators are binary operators, which need two operands to perform the operations.

List of C# Arithmetic Operators

Following table shows all the arithmetic operators supported by C#. Assume variable A holds 10 and variable B holds 20, then −

OperatorSymbolDescriptionExample
Addition+Adds two operandsA + B = 30
Subtraction-Subtracts second operand from the firstA - B = -10
Multiplication*Multiplies both operandsA * B = 200
Division/Divides numerator by de-numeratorB / A = 2
Modulus%Modulus Operator and remainder of after an integer divisionB % A = 0
Increment Operator++Increment operator increases integer value by oneA++ = 11
Decrement Operator--Decrement operator decreases integer value by oneA-- = 9
Technology
C# Programming
want to connect with us ?
Contact Us