in many programming languages numbers starting with leading 0 indicate base 8 (octal) representation of the number. here you are giving octal numbers as input and expecting the output in decimal and thats the reason you say output is wrong (which is correct!! wrt octal addition)
solution 1 : you can add two octal numbers and convert the result to decimal
solution 2 : convert the octal numbers to decimal and then add them