c program to find the sum of given number using recursion

Solutions on MaxInterview for c program to find the sum of given number using recursion by the best coders in the world

showing results for - "c program to find the sum of given number using recursion"
Yoann
10 Apr 2018
1# include <stdio.h>
2int sum(int number);
3int main
4{
5 int n;
6 int a;
7 printf("enter a number");
8 scanf("%d,&n);
9 a=sum(n);
10 printf("sum=%d",a);
11 }
12int sum(int number)
13{
14  if (number==0)
15    return 0;
16  return(number%10+sum(number/10);
17 }
queries leading to this page
sum of n numbers in c using recursionrecursion sum numberssum recursion in crecursive sum of digitssum of first n natural numbers in c using recursionsum of digits using recursive function in chow to find the sum of n digits in c code recursionc program to add the digits of a number using recursionc program for sum of digits and the number recursionfind the total using recursion in cwrite a program in c to find the sum of digits of a number using recursionrecursive sum program in csum of numbers using recursion in cfind the sum of 5 number using recursion in chow to do sum of array using recursion in crecursive function for sum in cfind digits sum of a number in c recursionsum of n natural numbers in c using recursionc program to find the sum of given number using recursion1 2b2 2b4 2b8 sum using recursion in csum of array using recursion in csum of digits in an integer using reccursionsum of series using recursion in cc 2b 2b program to find sum of digits using recursionsum of array elements using recursion csum of the digit of given number using recurtionrecursion to add sum of numbers cc program to calculate sum of numbers 1 to n using recursionsum of digits with recursionfind sum of n elements using recursion array in cc program to find sum array elements using recursionsum in c using recursionsum of natural numbers in c recursive functionc program to find sum of array elements using recursionsum of two numbers using recursion in cwrite a recursive function for sum of digits of any numbers in cfind sum in array recursionsum of even numbers using recursion in cfind sum of a digit in c using recursionsum of digits using recursion in chow to find sum of digits of a number in c using recursionsum of two numbers using recursionsum of digits of a number using recursion function csum of a series in c using recursionrecursion in c sum of digitsrecursion to find sum of digitssum of digit in c using recursionsum of digits of a number using recursion in cc recursion finding sum in arraysum of digits of a number in c using recursionsum of digits in c using recursionprogram to calculate sum of digits of a number in c using recursionsum of n numbers recursion in csum of a number using recursionsum of a all digits using recursion cprogram to find the sum of the digits using recursion c 2b 2bwrite a program in c to find the sum of digits of a number using recursion c program to find sum of n natural numbers using recursion in cfind sum of digits using recursivesum of elements of array using recursion in cc program to calculate the sum of digits of a number using recursion120 write a c program to find sum of elements of array using recursion get sum recursionsum of elements in an array using recursion in csum of numbers uysing recursionc program to find the sum of given number using recursion