Fundamentals
Numbers
Data Types
Integers
Ternary opertor FTW.
public static class Kata { public static bool IsOdd(int input) { return input % 2 != 0 ? true : false; } }
- public static class Kata
- {
- public static bool IsOdd(int input)
- {
return ((input % 10 == 1) || (input % 10 == 3) || (input % 10 == 5) || (input % 10 == 7) || (input % 10 == 9));- return input % 2 != 0 ? true : false;
- }
- }