Check Total Days in Month and The Year Is Leap or Not in c# using Switch-Case.
CODE: Console.WriteLine("Enter Year:"); int year = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Month Which Do You Want To Check:"); int month = Convert.ToInt32(Console.ReadLine()); switch (month) { case 1: Console.WriteLine("The Month is January Total days in this month is 31"); break; case 2: if ((year%4==0 && year%100 !=0)||year%400==0) { Console.WriteLine("{0} Year is leap",year); Console.WriteLine("days in this month is 29"); } else { Console.WriteLine("{0} Year is not leap", year); Console.WriteLine("days in this month is 28"); }