Advertisement
Bubeto

Untitled

Sep 19th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Even_Number
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. while (n % 2 == 1)
  11. {
  12. Console.WriteLine("Please write an even number.");
  13. n = int.Parse(Console.ReadLine());
  14. }
  15. if(n % 2 == 0)
  16. {
  17. Console.WriteLine("The number is: {0}", Math.Abs(n));
  18. }
  19.  
  20.  
  21.  
  22.  
  23.  
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement