get remainder by dividing the number by 10 in a loop and make sure that dont divide the same number again and again i.e remove the remainder part by dividing the number by 10 in each iteration. and store sum of the remainder in a variable.
take remainder in each iteration and save it in variable say remsum.
% is used to get remainder.
after that you have to remove that remainder from your orignal number because you have save it where you want to.
for this you have to divide it by 10. last digit will be removed because dividing the number by will give you a float and int dont save digits after decimal.
as you will use the loop that means you have to add remainder in the previous sum(i.e previous remainder.
for this you need to write
and make sure that you assign remsum=0 where you initialize it else it will start from a garbage value.