Not giving correct output

It is not giving correct output
Please tell me the reason for that.

error is that in string you can;t do
string s=“IAmACompetitiveProgrammer”;
string a;
a[0]=s[0];
cout<<a<<endl;
this is will not print anything you can do this
by declaring a ,s as character strings char [100]

in case of string class you can append char to the string

so modified code is
string s;
cin>>s;
string a;
int j=0;
for(int i=0;i<s.length();i++)
{
int e=s[i];
if(i!=0&&e>=65 and e<=90)
{
cout<<a<<endl;
a="";
a+=s[i];
j=1;
}
else{
a+=s[i];
j++;
}
}
cout<<a<<endl;

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.