using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace divsecnumisZero
{
class Program
{
static void Main(string[] args)
{
int Num1, Num2;
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Enter the first number");
Console.Write("Num1: ");
Num1 = Convert.ToInt32(Console.ReadLine());
Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine("\nEnter the Second number");
Console.Write("Num2: ");
Num2 = Convert.ToInt32(Console.ReadLine());
if (Num2 == 0)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("\nSorry Second number is Zero");
Console.Write("\nThank You");
}
else if (Num1 % Num2 == 0)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("\nFirst number is divisible by Second number");
Console.Write("\nThank You");
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("First number is Not divisible by Second number");
Console.Write("\nThank You");
}
Console.ReadLine();
}
}
}
No comments:
Post a Comment