Advertisement
saluxx

If input is wrong, ask again

Nov 4th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. string answer = String.Empty;
  2. do
  3. {
  4. Console.WriteLine("What do you want to do?");
  5. Console.WriteLine("1. Eat");
  6. Console.WriteLine("2. Drink");
  7. Console.WriteLine("3. Play");
  8. answer = Console.ReadLine();
  9. Console.Clear();
  10. } while (answer != "1" && answer != "2" && answer != "3");
  11.  
  12.  
  13. if (answer == "1")
  14. {
  15. Console.WriteLine("du tog 1");
  16. }
  17. //handle answer here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement