How to use the decimal remainder() method to get the part left over after the division complete in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(decimal.Remainder(3.0M, 2M));
            Console.WriteLine(decimal.Remainder(3.0M, 2.5M));
        }
    }
}

/*
run:
   
1.0
0.5

*/

 



answered Jan 17, 2017 by avibootz
...