+ 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,

30th Oct 2018, 9:19 PM
Abhay
Abhay - avatar
6 odpowiedzi
+ 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 !
31st Oct 2018, 2:54 PM
Abhay
Abhay - avatar
+ 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
31st Oct 2018, 3:23 PM
Abhay
Abhay - avatar
+ 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?:-)
31st Oct 2018, 3:25 PM
Abhay
Abhay - avatar
0
I dont understand... Can you make an simple example?
30th Oct 2018, 9:41 PM
KrOW
KrOW - avatar
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.
31st Oct 2018, 12:45 AM
Jared Bird
Jared Bird - avatar
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.
1st Nov 2018, 8:00 AM
Jared Bird
Jared Bird - avatar