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 _1._9._12_Even_Number
- {
- class Program
- {
- static void Main(string[] args)
- {
- int evenNum = int.Parse(Console.ReadLine());
- while (true)
- {
- int check = Math.Abs(evenNum) % 2;
- if (check == 1)
- {
- Console.WriteLine($"Please write an even number.");
- evenNum = int.Parse(Console.ReadLine());
- }
- else if (check == 0)
- {
- Console.WriteLine($"The number is: {Math.Abs(evenNum)}");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment