I getting stuck in string questions in which ASCII values are involved. How do I approach this problem?
Doubt in strings
Hi @sahilsaini137
All we need to do is just traverse the whole string and for every two adjacent characters just calculate the ascii among them. We will print the characters and the difference between with characters. And ascii among two char values can be calculated as follows :
int diff = int(str[i]) - int(str[i-1]) ;
If your doubt is clear than mark is as resolved.
do i need to return the same string with the values ?
@sahilsaini137
No need to return anything, what you can do is iterate over the string and print difference and character in the while loop only.