Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2.  
  3. class PlayWithIntDoubleAndString
  4. {
  5. static void Main()
  6. {
  7. Console.WriteLine("Please choose a type: \n1 --> int \n2 --> double \n3 --> string");
  8. int choise = int.Parse(Console.ReadLine());
  9. switch (choise)
  10. {
  11. case 1: Console.WriteLine(" Please enter a int: ");
  12. int a = int.Parse(Console.ReadLine());
  13. Console.WriteLine(++a);
  14. break;
  15. case 2: Console.WriteLine("Please enter a double: ");
  16. double b = double.Parse(Console.ReadLine());
  17. Console.WriteLine(++b);
  18. break;
  19. case 3: Console.WriteLine("Please enter as string:");
  20. string c = Console.ReadLine();
  21. Console.WriteLine(c + "*");
  22. break;
  23. default: Console.WriteLine("Invalid input!");
  24. break;
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement