kyrathasoft

getz

Jul 21st, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2. /*
  3. from Lesson 5 of C# console programming tutorial series at following URL:
  4. http://williammillerservices.com/windows-c-console-programming/
  5. demonstrates while looping until condition is met
  6. GitHub gist -> https://gist.github.com/kyrathasoft/6714b36f73d506433d0f8b864ec9d55a
  7. Pastebin.com -> https://pastebin.com/kTF8qhPi
  8. */
  9.  
  10. namespace MyNamespace
  11. {
  12.     class MyClass
  13.     {
  14.         static void Main(string[] args)
  15.         {
  16.             string sData = string.Empty; //to hold keyboard input
  17.  
  18.             while (sData != "z")
  19.             {
  20.                 Console.Write("Please enter a lowercase letter 'z': ");
  21.                 sData = Console.ReadLine();
  22.             }
  23.  
  24.             Console.WriteLine("Thank you. Lowercase 'z' was read from keyboard.");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment