Sum Of Digits Of A Number - Online Code

Description

TO find sum of digits of a number using recurrsion

Source Code

#include<stdio.h>
int sum(int num);
main()
{
int n;
printf("\n\tENTER THE NO. \t:\t");
scanf("%d",&n);
printf("\n\tTHE SUM OF DIGITS OF A NO. IS \t:\t%d\n",sum(n));
}
int sum(int num)
{
int a=0;
if(num==0)
return(0);
else
... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.




Comments

No comment yet. Be the first to post a comment.