How to do this without ascii codes?

i cant think anymore

@sagar_aggarwal there are two ways to do it without ascii codes. Although these also indirectly use ascii codes only. Dont forget to mark your doubt as resolved in case of no further queries :slight_smile:

  1. use the inbuilt functions islower() and isupper() they return a boolean value.
char ch;
cin >> ch;
if (isupper(ch)) {
    cout << 'U';
}
else if (islower(ch)) {
    cout << 'L';
}
else {
    cout << 'I';
}
  1. simply compare the characters with a and z for lowercase and with A and Z for uppercase
char ch;
cin >> ch;
if (ch >= 'A' && ch <= `Z`) {
    cout << 'U';
}
else if (ch >= 'a' && ch <= 'z') {
    cout << 'L';
}
else {
    cout << 'I';
}

:frowning: that was way too common-sense challange :joy:
Thanks ishita

@sagar_aggarwal please mark the doubt as resolved