Practical Number :
05 Roll No : 1615
Que 5) Write a console program to accept year and check it is leap year
or not.
using System;
using [Link];
using [Link];
using [Link];
using [Link];
namespace vinishaq5
class Program
{
public static void Main(string[ ] args)
[Link]("Enter a year to check if it's a leap year:");
string input = [Link]();
int year;
if ([Link](input, out year))
if ([Link](year))
[Link]($"{year} is a leap year.");
else
[Link]($"{year} is not a leap year.");
}
}
else
[Link]("Invalid input. Please enter a valid year (a whole
number).");
[Link]("Press any key to exit.");
[Link]();
Output of the Code :