I am unable to do with assci please specify another approach beacuse -1 ,-2 creating problem in assci
- since the ascii value of c is 99 and the ascii value of a is 97, simply doing ‘c’ - ‘a’ will give you 2.
So you can change line 7 toint c = s[i] - s[i - 1]this will give you diff in the ascii values of characters. - you need to find a workaround to display negative values, as just changing line 7 cannot display “-1” as it is.
think about how can you manipulate the value of c and the str string, in case c comes out to be negative after line 7
SInce you are not responding to this thread I am marking your doubt as resolved for now, please re-open it if required
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.