Skip to content

Commit 2e519e3

Browse files
authored
Create Leap_Or_Not.cs
1 parent ffc2d14 commit 2e519e3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Loops/Leap_Or_Not.cs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
3+
class Leap_Or_Not{
4+
static void Main(){
5+
string start= "Y";
6+
while(start != "n"){
7+
Wr_s("Please enter a year: ");
8+
int yr_inp =int.Parse(Console.ReadLine());
9+
if((yr_inp%4==0 && yr_inp%100 !=0)||yr_inp%400==0)
10+
{
11+
Wr_L($"{yr_inp} is a leap year");
12+
}
13+
14+
else{
15+
Wr_L("This is not a leap year");
16+
}
17+
Wr_s("Go Again?:");
18+
start = Console.ReadLine();
19+
}
20+
}
21+
static void Wr_L(object n){
22+
Console.WriteLine(n);
23+
}
24+
static void Wr_s(object o){
25+
Console.Write(o);
26+
}
27+
}

0 commit comments

Comments
 (0)