using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int Year; Console.WriteLine("Enter the year: "); Year = Convert.ToInt32(Console.ReadLine()); if ((Year % 4 == 0) && (Year % 100 != 0 || Year % 400 == 0)) { Console.WriteLine("The Year you have entered is a Leap Year {0}.", Year); } else { Console.WriteLine("The Year you have entered is not a Leap Year {0}.", Year); } Console.ReadLine(); } } }
Output:
0 comments:
Post a Comment