Regarding the usage of compare function

https://ide.codingblocks.com/s/653714 : I want to ask that why I am getting error while using compare function in this program.

compare() is used with strings not with char

str[i] is not string it’s a character
so str[i].compare is incorrect

in question you have to take only single character not the string
simply use this condition
if(ch>=β€˜A’ && ch<=β€˜Z’)
cout<<β€œU”<<endl;

@sb1251224_6919c19fccd96630 as i can see you have submitted the code and got 100 points hence give your feedback

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.