Compound operator : Arithmetic Operators « Operator « C# / CSharp Tutorial






using System;

public class CompoundAssApp
{
    public static void Main(string[] args)
    {
        int nCalc = 10;
        nCalc += 5;
        Console.WriteLine(nCalc);
   
        nCalc -= 3;
        Console.WriteLine(nCalc);
   
        nCalc *= 2;
        Console.WriteLine(nCalc);
   
        nCalc /= 4;
        Console.WriteLine(nCalc);
   
        nCalc %= 4;
        Console.WriteLine(nCalc);
    }
}








3.2.Arithmetic Operators
3.2.1.Arithmetic Operators
3.2.2.shortcut Operators
3.2.3.postfix and prefix
3.2.4.Compound operator