String difference

my logic is correct but code is not working??
here is my code:https://ide.codingblocks.com/s/249424

@jatinupadhyay786 it should be str[i] not i


dont forget to mark the doubt resolved and hit like if cleared :smiley: