To check uppercase, lowercase for given character

#include

using namespace std;

int main()
{
char ch;
cin >> ch;

if (ch >= 97 && ch <= 122)
{
    cout << "LowerCase" << ch;
}
else if (ch >= 65 && ch <= 90)
{
    cout << "UpperCase" << ch;
}
else
{
    cout << "Invalid";
}
cout << endl;

return 0;

}

what test i am failing please tell me…even the output is correct

#include
using namespace std;

int main()
{
char ch;
cin >> ch;

if (ch >= 97 && ch <= 122)
{
    cout << "lowercase";
}
else if (ch >= 65 && ch <= 90)
{
    cout << "UPPERCASE";
}
else
{
    cout << "Invalid";
}
cout << endl;

return 0;
}

I have corrected ur code… submit this and it will pass all test cases…

but what was i doing wrong can you please tell me?

lowercase instead of tis u were writing LowerCase
UPPERCASE instead of this -->UpperCase
and unnecessarily writing ch which is not expected in o/p

i have one more doubt can you help me with that too? it is based on pattern… i want to print reverse right angle triangle but my code is not right…when i am giving input as 6 it is printing one extra star this is my code

#include using namespace std; int main() { int row, column, n; cin >> n; for (row = n; row >= 1; row–) { for (column = n; column >=n-row; column–) { cout << “*”; } cout<< endl; } cout << endl; return 0; }

can you correct this it will help me a lot

pls ask doubt in that particular section only where this ques is present…

i hope ur this doubt is cleared??

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.