#include<iostream>
usingnamespace std;
#include<string>
int main()
{[INDENT]char y;
cout << "Enter a character or number: _\b";
cin >> y;
if(!isdigit(y))[INDENT]cout << "It's a Letter";
[/INDENT]else[INDENT]cout << "It's a Number";
[/INDENT]cout << '\n';
return 0;
[/INDENT]}
My friend, I think you are assuming too much of that if statement. What if the entered input is a space or a new line or " ?. Would that be considerate a letter?.
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218