Division on integers

Division on integers truncate the reminder.


using System;

class Program
{
    static void Main(string[] args)
    {
        int i = 4;
        int y = 3;
        
        int result = i / y;
        Console.WriteLine("result="+result);


    }
}

The output:


result=1
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.