Advertisement
Guest User

Nicicicicicicici

a guest
Jan 24th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Buddy_Pork
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.Write("Enter a Number : ");
  13.             var l = string.Empty;
  14.             while (l != "exit")
  15.             {
  16.                 l = Console.ReadLine();
  17.                 int i;
  18.                
  19.                 if (!int.TryParse(l, out i)) continue;
  20.                 Console.WriteLine(i % 2 == 0 ? "The number " + i + " is even " : "The number " + i + " is odd");
  21.                 Console.Write("Enter a number : ");
  22.             }
  23.             Console.ReadLine();
  24.            
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement