Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (true)
- {
- int number = int.Parse(Console.ReadLine());
- if (number % 2 == 0)
- {
- Console.WriteLine($"The number is: {Math.Abs(number)}");
- break;
- }
- else
- {
- Console.WriteLine($"Please write an even number.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement