In this program, you’ll learn to compute quotient and remainder from the given dividend and divisor in C#.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
class Program { static void Main(string[] args) { int dividend = 50, divisor = 8; int quotient = dividend / divisor; int remainder = dividend % divisor; Console.WriteLine("Dividend:{0} Divisor:{1}",dividend,divisor); Console.WriteLine("Quotient = " + quotient); Console.WriteLine("Remainder = " + remainder); Console.ReadLine(); } } |
Output: