Ascii to Integer implementation in c