YantraVision interview question

Pseudo code and c++code for sum of digits