Problem in sum of digit program

why are we doing n=n/10 in while loop of the program