not getting correct output
Diff in ascii codes
@guptashubham210a,
actually what is happening is you are overwriting your string, due to which you are losing some input characters
also, diff is an integer so you can’t do something like
a[i+1]=diff; it will add the character with ascii value as diff and if diff is negative then it will generate a runtime error
so overall it is better to take another string and perform operations on that
I have corrected your code refer below,
corrected code:-
In case of any doubt feel free to ask 
Mark your doubt as RESOLVED if you got the answer
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.