using System;
class abc
{
int a;
public void div()
{
Console.WriteLine("Enter The no to check that it is divisible by 5 or not");
a = Convert.ToInt32(Console.ReadLine());
if (a % 5 == 0)
{
Console.WriteLine("Divisibe by 5");
}
else
{
Console.WriteLine("Not divisible by 5");
}
Console.ReadKey();
}
}
class div1
{
public static void Main(string[] args)
{
abc a = new abc();
a.div();
}
}
Output:
class abc
{
int a;
public void div()
{
Console.WriteLine("Enter The no to check that it is divisible by 5 or not");
a = Convert.ToInt32(Console.ReadLine());
if (a % 5 == 0)
{
Console.WriteLine("Divisibe by 5");
}
else
{
Console.WriteLine("Not divisible by 5");
}
Console.ReadKey();
}
}
class div1
{
public static void Main(string[] args)
{
abc a = new abc();
a.div();
}
}
Output:
No comments :
Post a Comment