Added By: Editorial Staff | Last Updated:
In this program, we are going to share a C program to calculate the sum of all digits using recursion. If you are a beginner and want to start learning the C programming, then keep your close attention in this tutorial as I am going to share a C program to calculate the sum of all digits using recursion with the output.
We have designed this program for beginners for learning purpose. Copy below c program and execute it with c compiler to see the output of the program.
int sumDigits(int num)
static int sum=0;
printf("Enter a positive integer number: ");
printf("Sum of all digits are: %d\n",sum);
Enter a positive integer number: 1230
Sum of all digits are: 6
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff