Write a program in c to count the number of digits of a given number using recursion.
Answers
Answered by
1
The program output is also shown below.
* C Program to find Sum of Digits of a Number using Recursion.
int sum (int a);
int num, result;
printf("Enter the number: ");
scanf("%d", &num);
result = sum(num);
printf("Sum of digits in %d is %d\n", num, result);
return 0;
* C Program to find Sum of Digits of a Number using Recursion.
int sum (int a);
int num, result;
printf("Enter the number: ");
scanf("%d", &num);
result = sum(num);
printf("Sum of digits in %d is %d\n", num, result);
return 0;
Similar questions
Math,
8 months ago
Computer Science,
8 months ago
English,
8 months ago
Math,
1 year ago
English,
1 year ago