Advertisement
NikolaySpasovTriset

NumbersInRange 0-100

Oct 11th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. using System;
  2.  
  3. class testLoops
  4. {
  5. static void Main()
  6. {
  7. int n = int.Parse(Console.ReadLine());
  8. while (n <= 0 || n > 100)
  9. {
  10. Console.WriteLine("Invalid Number!");
  11. int num = int.Parse(Console.ReadLine());
  12. n = num;
  13. }
  14. Console.WriteLine("The number is: " + n);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement