Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _12.EvenNumber
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool isEven = false;
- while (!isEven)
- {
- int input = Math.Abs(int.Parse(Console.ReadLine()));
- if (input % 2 != 0)
- {
- Console.WriteLine("Please write an even number.");
- continue;
- }
- else
- {
- Console.WriteLine($"The number is: {input}");
- isEven = true;
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement