using System;
namespace leapyear
{
class Program
{
static void Main(string[] args)
{
int yr;
yr = Convert.ToInt32(Console.ReadLine());
if ((yr % 4 != 0) || (yr % 100 == 0 && yr % 400 != 0))
{
Console.WriteLine("this is not a leap yr");
}
else if ((yr % 4 == 0) && (yr % 100 != 0))
{
Console.WriteLine("this is leap year");
}
else
Console.WriteLine("this is leap year");
Console.ReadKey();
}
}
}
namespace leapyear
{
class Program
{
static void Main(string[] args)
{
int yr;
yr = Convert.ToInt32(Console.ReadLine());
if ((yr % 4 != 0) || (yr % 100 == 0 && yr % 400 != 0))
{
Console.WriteLine("this is not a leap yr");
}
else if ((yr % 4 == 0) && (yr % 100 != 0))
{
Console.WriteLine("this is leap year");
}
else
Console.WriteLine("this is leap year");
Console.ReadKey();
}
}
}
No comments:
Post a Comment