Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Buddy_Pork
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Enter a Number : ");
- var l = string.Empty;
- while (l != "exit")
- {
- l = Console.ReadLine();
- int i;
- if (!int.TryParse(l, out i)) continue;
- Console.WriteLine(i % 2 == 0 ? "The number " + i + " is even " : "The number " + i + " is odd");
- Console.Write("Enter a number : ");
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement