Failing one test case

1.please check my code and the logic .?
2.where is the problem coming ?
3.and why do i have to use break in line 18 ?without break it prints the first charcater twice
code ID:260204

if(s[0]>='A' and s[0]<='Z')cout<<s[0];
if(s[1]>='A' and s[1]<='Z')cout<<endl;

preprocess the first character after that it will give correct output

this is because when you come out of loop big=Z+1
ans s[i]!=z+1
so it again print s[i]

your approach is not good
instead of inner loop you can check whether the given char is uppercase or not in one single line
like this
if(s[i]>=ā€˜A’ and s[i]<=ā€˜Z’)

modified code