Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class IfSelect
- {
- public static void Main()
- {
- string myInput;
- int myInt;
- Console.Write("Please enter a number: ");
- myInput = Console.ReadLine();
- myInt = Int32.Parse(myInput);
- if (myInt <= 1)
- {
- Console.WriteLine("coke");
- }
- else if (myInt <= 2)
- {
- Console.WriteLine("sprite");
- }
- else if (myInt <= 3)
- {
- Console.WriteLine("royal");
- }
- else if (myInt <= 4)
- {
- Console.WriteLine("pepsi");
- }
- else if (myInt <= 5)
- {
- Console.WriteLine("rootbeer");
- }
- else
- {
- Console.WriteLine("pick your drinks");
- }
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement