SHOW:
|
|
- or go back to the newest paste.
| 1 | using System; | |
| 2 | ||
| 3 | namespace EvenNumber | |
| 4 | {
| |
| 5 | class Program | |
| 6 | {
| |
| 7 | static void Main(string[] args) | |
| 8 | {
| |
| 9 | int input = int.Parse(Console.ReadLine()); | |
| 10 | ||
| 11 | while (input % 2 != 0) | |
| 12 | {
| |
| 13 | Console.WriteLine("Please write an even number.");
| |
| 14 | ||
| 15 | input = int.Parse(Console.ReadLine()); | |
| 16 | ||
| 17 | if (input % 2 == 0) | |
| 18 | {
| |
| 19 | break; | |
| 20 | } | |
| 21 | } | |
| 22 | ||
| 23 | Console.WriteLine($"The number is: {Math.Abs(input)}");
| |
| 24 | } | |
| 25 | } | |
| 26 | } |