The C standard requires that the characters '0' to '9' have consecutive values.
'0' represents the value zero as a character and c is the value you enter it calculates to be like this :
'1' - '0' == 1
'2' - '0' == 2
and so on ... i.e equal to the value of c if c is a digit