Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. class IfSelect
  4. {
  5. public static void Main()
  6. {
  7. string myInput;
  8. int myInt;
  9.  
  10. Console.Write("Please enter a number: ");
  11. myInput = Console.ReadLine();
  12. myInt = Int32.Parse(myInput);
  13.  
  14.  
  15.  
  16. if (myInt <= 1)
  17. {
  18. Console.WriteLine("coke");
  19. }
  20.  
  21. else if (myInt <= 2)
  22. {
  23. Console.WriteLine("sprite");
  24. }
  25. else if (myInt <= 3)
  26. {
  27. Console.WriteLine("royal");
  28. }
  29. else if (myInt <= 4)
  30. {
  31. Console.WriteLine("pepsi");
  32. }
  33. else if (myInt <= 5)
  34. {
  35. Console.WriteLine("rootbeer");
  36. }
  37.  
  38. else
  39.  
  40. {
  41. Console.WriteLine("pick your drinks");
  42. }
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. Console.ReadKey();
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement