Days in a month in C#

Days in a month in C#

using System;

public class Program
{
    public static void Main()
    {
        Console.WriteLine("Days in a month in C#\n");
        Console.WriteLine("Enter year");
        int year = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter month");
        int month = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Days in the month:" + DateTime.DaysInMonth(year, month));
    }
}
DEMO
Days in a month in C# Days in a month in C# Reviewed by Bhaumik Patel on 7:17 PM Rating: 5