How to calculate the remainder in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main()
    {
        int a = 18;
        int b = 5;

        int r = a % b;   

        Console.WriteLine("Remainder = " + r);
    }
}



/*
run:

Remainder = 3

*/

 



answered Mar 4 by avibootz
...