yes that was the confusion.Can you please guide me how I am getting the value of i=8.
you have used "i=010" in your code which assigns the value 8 to the variable i,your query is how the value 8 is assigned to i.
this is how it will be converted from octal to decimal
(1*8^1+0*8^0).