Write a C# Sharp program to display the number of days of the year between two specified years
- برمجة سي شارب
- برمجة
- 2021-05-31
- ahmadghneem
الأجوبة
using System;
public class Example4
{
public static void Main()
{
DateTime dec31 = new DateTime(2000, 12, 31);
for (int ctr = 0; ctr <= 20; ctr++) {
DateTime dateToDisplay = dec31.AddYears(ctr);
Console.WriteLine("{0:d}: day {1} of {2} {3}", dateToDisplay,
dateToDisplay.DayOfYear,
dateToDisplay.Year,
DateTime.IsLeapYear(dateToDisplay.Year) ?
"(Leap Year)" : "");
}
}
} أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال