VelizarAvramov

11. Odd Number

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