+ 2
How can i find ascii values of two letters of same srrings that aren't same
https://code.sololearn.com/cneMEqivFSOr/?ref=app need to perform subtraction operation btw the letters of string that aren't equal and print the result,
6 Answers
+ 1
yea I tried to subtract them by I don't know where to include the statement and how,let me show what I tried to do !
+ 1
my mistake, before asking the question this was how did âŹïž,but forgot to use %d that's why it wasn't giving me the output and I thought I was doing wrong ,lol
+ 1
There is still something wrong in statement when I input two different strings ,answer is correct ,can you tell me what should I change jared?:-)
0
I dont understand... Can you make an simple example?
0
Abhay In C string are just arrays of charactersâ, charactersâ are just an int type that storesâ the ASCII value. If you want to subtract them just subtract them, no special cast or anything is needed.
0
Ok I can see 2 main issues:
The for loop should test for is not a null character instead of is a null character.
The last else is missing the {} brackets.