Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- long number;
- string input;
- do
- {
- Console.Write("Enter a valid type long number: ");
- input = Console.ReadLine();
- } while (!long.TryParse(input, out number));
- if (number % 2 == 0)
- {
- Console.WriteLine("The number is even");
- }
- else
- {
- Console.WriteLine("The number is odd");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement