Arithmetic operators in c# | #MortalTech | #16



Arithmetic operators in c# | #MortalTech | #16

Arithmetic operators in c# | #MortalTech | #16

Arithmetic Operators
The arithmetic operators perform arithmetic operations on all the numeric type operands such as sbyte, byte, short, ushort, int, uint, long, ulong, float, double, and decimal.

Operator Name Description Example
+ Addition Computes the sum of left and right operands. int x = 5 + 5;
– Subtraction Subtract the right operand from the left operand int x = 5 – 1;
* Multiplication Multiply left and right operand int x = 5 * 1;
/ Division Divides the left operand by the right operand int x = 10 / 2;
% Reminder Computes the remainder after dividing its left operand by its right operand int x = 5 % 2;
++ Unary increment Unary increment ++ operator increases its operand by 1 x++
— Unary decrement Unary decrement — operator decreases its operand by 1 x–
+ Unary plus Returns the value of operand +5
– Unary minus Computes the numeric negation of its operand. -5

You can also find me here:
Instagram: MortalsTech
Facebook: MortalTech
Twitter: Mortalstech