Mega Code Archive

 
Categories / C# Tutorial / Data Type
 

Integers and arithmetic operators

class MainClass {   public static void Main()   {          System.Console.WriteLine("10 / 3 = " + 10 / 3);     System.Console.WriteLine("10 % 3 = " + 10 % 3);     int intValue1 = 10;     int intValue2 = 3;     System.Console.WriteLine("intValue1 / intValue2 = " + intValue1 / intValue2);     System.Console.WriteLine("intValue1 % intValue2 = " + intValue1 % intValue2);   } } 10 / 3 = 3 10 % 3 = 1 intValue1 / intValue2 = 3 intValue1 % intValue2 = 1