Code correction

How is this code wrong as the output comes out to be correct.

@Codarikh hey abhyuday can I see your implementation?

#include
#include
using namespace std;
int main() {
char str[1000];
cin.get(str,1000);
int i=0;
while(i<=strlen(str)){
cout<<str[i];
i++;
if(int(str[i])<=90)cout<<endl;
}

return 0;

}

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.