Dianov

While Loop - Lab (02. Password)

Dec 27th, 2020
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Password
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string userName = Console.ReadLine();
  14.             string password = Console.ReadLine();
  15.             string enterPassword = Console.ReadLine();
  16.  
  17.             while (enterPassword != password)
  18.             {
  19.                 enterPassword = Console.ReadLine();
  20.             }
  21.             Console.WriteLine("Welcome {0}!", userName);
  22.         }  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment