Why this code isnt working for this ques

#include<bits/stdc++.h>
using namespace std;

int main(){
char str[10];
cin>>str;
int d=strlen(str);
cout<<d;
int a[d+1]={0};
for(int i=0;str[i]!=’\0’;i++){
a[i]=str[i]-’\0’;
cout<<a[i]<<endl;
}

cout<<str[0];

for(int i=1;i<d;i++){
if(a[i]>=97 && a[i]<=122){
	cout<<str[i];
}
else
cout<<endl;
cout<<str[i];

}

return 0;

}

hi akash
save your code to online ide of coding block ans then post the link here

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.