how to display the string in this format
How to display the string
Sample Input
acb
Sample Output
a2c-1b
Ascii value of ‘c’ - acii value of ‘a’ =2
Ascii value of ‘b’ - acii value of ‘c’=-1
So output is a2c-1b
If you take a character in integer variable, it will represent its ascii value.
Ascii value of a-z is 97 to 122
Ascii value of A-Z is 65 to 90
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.