Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main()
- {
- Console.WriteLine("Enter a random number to check if it's odd or even.");
- int userInput = int.Parse(Console.ReadLine());
- bool numberOdd = userInput % 2 == 1;
- Console.WriteLine("The number {0} is odd: - {1}", userInput, numberOdd);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement