Sum of Digits

in the code of sum of digits i tried to input diffrent values and lenghts of numbers but saw that max output of sum that came was 46. for eg : when i input a number with eight 5 then out=40 but when i input ten or more 5 the output is 46(max) is there a limit while using while loop?

@discobot no limit on while loop but there might be integer overflow use long long int

Hi! To find out what I can do, say @discobot display help.