add Programmyday form github
This commit is contained in:
22
EvenOrOddExtention/Program.cs
Normal file
22
EvenOrOddExtention/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace EvenOrOddExtention
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int input = 105;
|
||||
Console.WriteLine(input.EvenOrOdd());
|
||||
}
|
||||
}
|
||||
static class EvenOrOddExtention
|
||||
{
|
||||
public static string EvenOrOdd(this int input)
|
||||
{
|
||||
if (input % 2 != 0)
|
||||
{
|
||||
return "Odd";
|
||||
}
|
||||
return "Even";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user