There are five of arithmetic operators available in C #:
+ addition operator
-Subtraction operator
* Multiplication operator
/Division Operator
% remainder operator
In the operation of an expression, expressions are always evaluated in the order in which they are written, as in the following example:
Program Listing 7-1:
Using System;
Class Test
{
static void F (int x,int y,int z) {
Console.WriteLine ("X={0},y={1},z={2}", x,y,z);
}
public static void Main () {
int i=0;
F (i++,i++,i++);
}
Output Result:
x=0,y=1,z=2
7.2.1 addition operation
7.2.2 Subtraction Operation
7.2.3 multiplication operation
7.2.4 Division Operations
7.2.5 calculation
The "/" operator is used to find the quotient of division, and the "%y" operator is used to find the remainder of the division. The modulo operation in C # applies both to the integer type and to the floating-point type and the decimal type. For example, the result of 5%3 for 2,5%1.5 is 0.5.