Ascii Code Difference- String problem

https://ide.codingblocks.com/s/235704 please check why am I not getting the correct answer and why am I being shown garbage value. Also, can we convert int into char by +β€˜0’

@rachitbansal2500 you are not calculating difference correctly. try using - β€˜0’ and + β€˜0’ if still problem then tell

Hey it is still there

@rachitbansal2500 your logic is wrong your o/p will be in form abbc for abc so look at this code for reference simply print it at that time https://ide.codingblocks.com/s/236152

1 Like

and here is your code corrected only difference part https://ide.codingblocks.com/s/236155

1 Like

Thanks! so basically we just had to output the result and not manipulate the string?

np yes we can manipulate but we dont need to.
if you are interested then you can take a string str="" and whenever we are cout just append in this string by making it character
@rachitbansal2500

1 Like

Why can’t we take input like normal character array?

yes you can use anything to store the answer character array too. its upto you in which you feel comfortable @rachitbansal2500 :smiley:
i hope your doubt is cleared if yes dont forget to mark it as resolved

Hey I was having this very conversation with another TA String not getting displayed I am confused now?

what confusion @rachitbansal2500?

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.