Guest User

Untitled

a guest
Jan 31st, 2019
616
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. string input = Console.ReadLine();
  11. int valueInt;
  12. float valueFloat;
  13. char valueChar;
  14. bool valueBoolean;
  15.  
  16. while (input != "END")
  17. {
  18. if (int.TryParse(input, out valueInt))
  19. {
  20. Console.WriteLine($"{input} is integer type");
  21. }
  22. else if (float.TryParse(input, out valueFloat))
  23. {
  24. Console.WriteLine($"{input} is floating point type");
  25. }
  26. else if (char.TryParse(input, out valueChar))
  27. {
  28. Console.WriteLine($"{input} is character type");
  29. }
  30. else if (bool.TryParse(input, out valueBoolean))
  31. {
  32. Console.WriteLine($"{input} is boolean type");
  33. }
  34. else
  35. {
  36. Console.WriteLine($"{input} is string type");
  37. }
  38. input = Console.ReadLine();
  39. }
  40. }
  41. }
  42. }
RAW Paste Data