Leap Year Programm in C#
C#:
Leap Year=2012;
Not LeapYear=2013;
L_Year=2012;
public string LeapYear(int L_Year)
{
int Year =L_Year;
//int Year =2012;
//int Year =2013;
if (Year % 4 != 0) //4 year one time LeapYear So divide in 4
{
// 4 mod !=0 Not Leap Year
a = "Not Leap Year";
}
else
{
// 4 mod =0 Leap Year
a = "Leap Year";
}
return a;
}
string Y;
Y = LeapYear(2012);
Response.Write(Y);
Ans:
2012 = LeapYear;
No comments:
Post a Comment