Wednesday, May 18, 2016

C# program to Check lp Yr Using Conditional Statement

C# program to Check Yr is lp or not Using Conditional Statement
Program Statement:Write a program using conditional operators to determine whether a yr entered through the board is a lp yr or not.
Solution:static void Main(string[] args)
int yr;
Console.WriteLine("Enter Yr");
yr = Convert.ToInt32(Console.RdLine());
Console.WriteLine( yr % 4 == 0 ? "Entered yr is lp" : "Not lp yr");

No comments:

Post a Comment