+ 1
c program to determine the datatype of input?
if you enter a charatcer ,integer or floating point number, the program should determine and display the type as output.
1 Answer
+ 4
I can't code it now but basically you need to take the input into a string with scanf, and then parse it. If it contains a "." then it is a float. If it has an alphabetical (A to Z or a to z or any special char), then it is a char. If it has only numbers then it is an integer.