Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- Console.WriteLine("Give me a year and i will tell u wether its a leap year or not");
- int given_year = Convert.ToInt32(Console.ReadLine());
- Leap_Year_Function(given_year);
- Console.ReadKey();
- }
- public static int Leap_Year_Function(int given_year)
- {
- if (given_year % 4 == 0 && given_year % 100 != 0)
- {
- Console.WriteLine(given_year + " is a leap year");
- return given_year;
- }
- if (given_year % 400 == 0)
- {
- Console.WriteLine(given_year + " is a leap year");
- return given_year;
- }
- else
- {
- Console.WriteLine(given_year + " is not a leap year");
- return given_year;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement