anizko

01. Number in Range [1...100]

Apr 4th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Лаб_Повторения_с_цикли___while_цикъл
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int Number = int.Parse(Console.ReadLine());
  10.  
  11.             while(Number<1||Number>100)
  12.             {
  13.                 Console.WriteLine("Invalid number!");
  14.                 Number=int.Parse(Console.ReadLine());
  15.             }
  16.             Console.WriteLine($"The number is:{Number}");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment