Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 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 ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. Console.WriteLine("Ange en siffra mellan 1 - 3");
  15. start:
  16. int tal = int.Parse(Console.ReadLine());
  17.  
  18. switch (tal)
  19. {
  20. case 1:
  21. Console.WriteLine("Du angav 1");
  22. break;
  23. case 2:
  24. Console.WriteLine("Du angav 2");
  25. break;
  26. case 3:
  27. Console.WriteLine("Du angav 3");
  28. break;
  29. default:
  30. Console.WriteLine("Du angav felaktigt alternativ");
  31. goto start;
  32. break;
  33. }
  34. Console.ReadLine();
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement