C# Recipe #1 – Check if the given integer is a multiple of a number ?

The modulus operator (%) in can be used to find out if the given number is a multiple of the same number

How to Find if the given number is a multiple of the same number in C# ?

using System;
namespace GeeksTutorConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 51;
            int output = i % 51;
            Console.WriteLine(output);
            Console.ReadLine();
        }
    }
}

Leave a Reply