programming-examples/c-sharp/Mathematics/C# Program to Find whether the Number is Divisible by 2.cs

36 lines
758 B
C#
Raw Permalink Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Find whether the Number is Divisible by 2
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication16
{
class Program
{
static void Main(string[] args)
{
int n;
Console.WriteLine("Enter the Number :");
n = int.Parse(Console.ReadLine());
if (n % 2 == 0)
{
Console.WriteLine("Entered Number is Divisible by 2 ");
}
else
{
Console.WriteLine("Entered Number is Not Divisible by 2");
}
Console.ReadLine();
}
}
}
/*
Enter the Number :
45
Entered Number is Not Divisible by 2