Chewbacca and number,hackerblocks

i did not get how int digit= a[i]-‘0’; converts the
ascii value into digit

hey Shivam, there is an internal typecasting which says char- char=int.
if a[i]=‘1’ its ascii value is 92 and ascii value of zero is 91.
So a[i]-‘0’=91-90=1 which is int value of a[i].