Advertisement
Grimmjow1

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

Feb 2nd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System;
  2.  
  3. namespace numbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             while (n<1||n>100)
  11.             {
  12.                 Console.WriteLine("Invalid number!");
  13.                 n = int.Parse(Console.ReadLine());
  14.  
  15.             }
  16.             Console.WriteLine(n);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement