Advertisement
Guest User

Code

a guest
Oct 6th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Variables_2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Chose a number between one and three.");
  14. string userValue = Console.ReadLine();
  15.  
  16. string message = "";
  17.  
  18. // These are the IF statements.
  19.  
  20. if (userValue == "1")
  21. message = "You chose 1!";
  22. if (userValue == "2")
  23. message = "You chose 2!";
  24. if (userValue == "3")
  25. message = "You chose 3!";
  26. else
  27. message = "You didn't chose 1, 2, or 3!";
  28.  
  29. Console.WriteLine(message);
  30. Console.ReadLine();
  31.  
  32.  
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement