Error in op please help


please check code -28 at end is extra.

@rastogi.g1998
You were accessing as[i+1], so i should be i < l-1

i tried but it removed b as well from op

@rastogi.g1998
then you can print the last character manually. I have attached the corrected code of yours, please check.

for(int i=0;i<l-1;i++){
diff[i]= as[i+1]-a[i];
cout<<a[i]<<diff[i];
}
cout<<a[l-1];

also i am extremely weak in strings and character array

just keep on practicing, you will get better.