Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- /*
- from Lesson 5 of C# console programming tutorial series at following URL:
- http://williammillerservices.com/windows-c-console-programming/
- demonstrates while looping until condition is met
- GitHub gist -> https://gist.github.com/kyrathasoft/6714b36f73d506433d0f8b864ec9d55a
- Pastebin.com -> https://pastebin.com/kTF8qhPi
- */
- namespace MyNamespace
- {
- class MyClass
- {
- static void Main(string[] args)
- {
- string sData = string.Empty; //to hold keyboard input
- while (sData != "z")
- {
- Console.Write("Please enter a lowercase letter 'z': ");
- sData = Console.ReadLine();
- }
- Console.WriteLine("Thank you. Lowercase 'z' was read from keyboard.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment