Advertisement
Spocoman

12. Even Number

Jan 10th, 2022
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System;
  2.  
  3. namespace EvenNumber
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int num = int.Parse(Console.ReadLine());
  10.             while (num % 2 != 0)
  11.             {
  12.                 Console.WriteLine("Please write an even number.");
  13.                 num = int.Parse(Console.ReadLine());
  14.             }
  15.             Console.WriteLine($"The number is: {Math.Abs(num)}");
  16.         }
  17.     }
  18. }
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement