Type conversion doubts

why a[i]= digit +‘0’ , why here ‘0’ is added??
also above that why - ‘0’ is done

to get the char value of integer we add ‘0’ .
similarly for subtraction:
by subtracting the ASCII value of char 0 (represented as ‘0’), we get the int value of the digit represented in char format .