Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- try
- {
- Console.Write("Enter even number: ");
- var n = int.Parse(Console.ReadLine());
- if (n % 2 == 0) {break;}
- Console.WriteLine("The number is not even.");
- }
- catch
- {
- Console.WriteLine("Invalid number.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement