vb.net

Check Leap Year using VB.NET

In this blog we will learn Check Leap Year using VB.NET.

In this blog we will check the provided year is leap year or not?

Code for Check Leap Year using VB.NET

using System;

namespace Program
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter Year : ");
            int Year = int.Parse(Console.ReadLine());
            if (((Year % 4 == 0) && (Year % 100 != 0)) || (Year % 400 == 0)) Console.WriteLine("{0} is a Leap Year.", Year);
            else Console.WriteLine("{0} is not a Leap Year.", Year);
            Console.ReadLine();
            Console.ReadLine();
        }
    }
}

Advertisement

Output

check-leap-year-using-vb-net

check-leap-year-using-vb-net

Advertisement

Leave a Reply

Your email address will not be published. Required fields are marked *