Write a C# Sharp program to find the leap years between 1994 and 2014
- برمجة سي شارب
- برمجة
- 2021-06-01
- ahmadghneem
الأجوبة
using System;
public class Example28
{
public static void Main()
{
for (int year = 1995; year <= 2016; year++)
{
if (DateTime.IsLeapYear(year))
{
Console.WriteLine("{0} is a leap year.", year);
DateTime leapDay = new DateTime(year, 2, 29);
DateTime nextYear = leapDay.AddYears(1);
Console.WriteLine(" One year from {0} is {1}.",
leapDay.ToString("d"),
nextYear.ToString("d"));
}
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال