function output= digit_sum(n)if n<10 output=fix(n);endif n>0output=output+digit_sum(n*0.1);endend
I wrote this code but the problem I am facing is if i set output=0; anywhere then in all the recalling function process my result will turn to be 0, How to Solve this ?
Best Answer