Sum of digits error

the sume of digits is not working for higher values of n

for which value of n you are using and
also send link of your code generated
after saving at https://ide.codingblocks.com/