c program to find the sum of given number using recursion

# include <stdio.h>
int sum(int number);
int main
{
 int n;
 int a;
 printf("enter a number");
 scanf("%d,&n);
 a=sum(n);
 printf("sum=%d",a);
 }
int sum(int number)
{
  if (number==0)
    return 0;
  return(number%10+sum(number/10);
 }

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
sum of natural numbers in c recursive function sum of digits of a number using recursion in c sum of even numbers using recursion in c write a recursive function for sum of digits of any numbers in c find sum of n elements using recursion array in c Write a program in C to find the sum of digits of a number using recursion. c program to calculate sum of numbers 1 to n using recursion c++ program to find sum of digits using recursion c program to find sum of array elements using recursion c program to find sum array elements using recursion sum of a series in c using recursion Sum of numbers using recursion in C find digits sum of a number in c recursion sum of digits using recursion in c sum of digits using recursive function in c how to find the sum of n digits in c code recursion sum of digits of a number in c using recursion Sum recursion in C sum of n numbers recursion in c recursion in c sum of digits sum of elements of array using recursion in c find the sum of 5 number using recursion in c sum of digit in c using recursion sum of a all digits using recursion c how to do sum of array using recursion in c sum of n numbers in c using recursion 1+2+4+8... sum using recursion in c sum of elements in an array using recursion in c sum of two numbers using recursion in c get sum recursion c program for sum of digits and the number recursion how to find sum of digits of a number in c using recursion sum in c using recursion sum of digits in c using recursion c recursion finding sum in array sum of array using recursion in c program to find the sum of the digits using recursion c++ find sum in array recursion sum of the digit of given number using recurtion sum of a number using recursion c program to find sum of n natural numbers using recursion in c sum of digits in an integer using reccursion sum of two numbers using recursion recursive sum of digits c program to add the digits of a number using recursion recursion sum numbers sum of numbers uysing recursion recursive function for sum in C recursion to add sum of numbers C sum of first n natural numbers in c using recursion sum of n natural numbers in c using recursion recursion to find sum of digits find sum of digits using recursive Sum of digits with recursion find sum of a digit in c using recursion c program to find the sum of given number using recursion
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source