📅  最后修改于: 2022-03-11 15:04:33.700000             🧑  作者: Mango
//Recursive function to find sum of digits of a number
int sumOfDigits(int num){
// Base condition
if(num == 0){
return 0;
}
return ((num % 10) + sumOfDigits(num / 10));
}