Advertisement
coasterka

#3OddOrEvenInteger

Mar 13th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1. static void Main()
  2.         {
  3.             Console.WriteLine("Enter a random number to check if it's odd or even.");
  4.             int userInput = int.Parse(Console.ReadLine());
  5.             bool numberOdd = userInput % 2 == 1;
  6.             Console.WriteLine("The number {0} is odd: - {1}", userInput, numberOdd);
  7.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement