I just did my 2nd one and I pretty much did it the same but I used the float A; then I used A as the cin>>. So of course it didnt work, I then put Char C as directed by soemone else and kept the same stuff and wow, it worked. So how come I had to use a Char C? I was reading but I'm still a little fuzzy on the details, it worked for digits, letters but what is the difference vs. int or float? Thanks
Bryan Oh ya, here is my new code
Code:
#include <iostream>
using namespace std;
int main()
{
char C;
cout << "Enter any character then press enter:" << endl;
cin >> C;
if (C>='A' && C<='Z')
cout << "The character you entered was a Upper-Case Letter" << endl;
else if (C>='a' && C<='z')
cout << "The character you entered was a Lower-Case Letter" << endl;
else if (C>='0' && C<='9')
cout << "The character you entered was a Digit" << endl;
else
cout << "The character you entered was none of the above" << endl;
return 0;
}