namespace rojak2.cs
{
class Program
{
static void Main(string[] args)
{
ArithmeticOperators();
}
static void ArithmeticOperators()
{
double totalAmount = 100;
double result;
Console.WriteLine("totalAmount is {0}", totalAmount);
Console.WriteLine();
result = totalAmount + 100;
Console.WriteLine("totaAmount is {0}", result);
result = totalAmount - 50;
Console.WriteLine("totaAmount is {0}", result);
result = ++totalAmount;
Console.WriteLine("totaAmount is {0}", totalAmount);
result = --totalAmount;
Console.WriteLine("totaAmount is {0}", totalAmount);
}
}
}
my question is why the last output of result is 100 not 99? it should be decreased from 100 not 101. I dont quite get it.