Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace dataTypeFinder
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- var input = Console.ReadLine();
- while (input != "END")
- {
- if (int.TryParse(input, out _))
- {
- Console.WriteLine($"{input} is integer type");
- }
- else if(double.TryParse(input, out _))
- {
- Console.WriteLine($"{input} is floating point type");
- }
- else if(char.TryParse(input, out _))
- {
- Console.WriteLine($"{input} is character type");
- }
- else if(bool.TryParse(input, out _))
- {
- Console.WriteLine($"{input} is boolean type");
- }
- else
- {
- Console.WriteLine($"{input} is string type");
- }
- input = Console.ReadLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment