Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Number_in_Range_1to100
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num = int.Parse(Console.ReadLine());
- while (num < 1 || num > 100)
- {
- Console.WriteLine("Invalid number!");
- num = int.Parse(Console.ReadLine());
- }
- Console.WriteLine("The number is: {0}", num);
- }
- }
- }
- /* //Pesho , 123, да се изпълни програмата само , ако потребителя въведе правилните данни
- string name = Console.ReadLine();
- string pass = Console.ReadLine();
- while (name!="Pesho" || pass != "123" )
- {
- Console.WriteLine("Invalid input.");
- name = Console.ReadLine(); //ако не въведем отново стойността ще получим безкраен цуикъл
- pass = Console.ReadLine();
- }
- Console.WriteLine("Welkome");
- }
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment