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;
- using System.Threading.Tasks;
- namespace ConsoleApplication261
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = (Console.ReadLine());
- if (int.Parse(n) % 2 == 0)
- {
- Console.WriteLine("Even number entered: {0}", n);
- return;
- }
- else
- {
- while (int.Parse(n) % 2 != 0)
- {
- n = Console.ReadLine();
- Console.WriteLine("Invalid number!");
- if (int.Parse(n) % 2 == 0)
- {
- Console.WriteLine("Even number entered: {0}", n);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement