C# program to Check Year is leap or not Using Conditional Statement
Program Statement:
Write a program using conditional operators to determine whether a year entered through the keyboard is a leap year or not.
Solution:
static void Main(string[] args)
{
int year;
Console.WriteLine("Enter Year");
year = Convert.ToInt32(Console.ReadLine());
Console.WriteLine( year % 4 == 0 ? "Entered year is leap" : "Not leap year");
Console.ReadLine();}
Articles about C# program to Check leap Year Using Conditional Statement finished discussed
We think it is enough information about C# program to Check leap Year Using Conditional Statement , hopefully the information we give can give benefit for you,
If you feel the information C# program to Check leap Year Using Conditional Statement that we provide can provide benefits for others please share with link https://darellsfinancialcorner.blogspot.com/2013/12/c-program-to-check-leap-year-using.html thank you for visiting our blog page and do not forget to visit other
0 komentar:
Posting Komentar