sumdig(int n)// function defination
{
static int s=0;
int d;
if(n!=0)
{
d=n%10;
n=(n-d)/10;
s=s+d;
sumdig(n);
}
else
return(s);
}
every body explains me line wise bcz i new to c language.
specially functions
tel me what is th mean of sumdig(int n)
int sumdig(int n) {
if ( n < 1 )
return 0;
else
return ( n%10 + sumdig(n/10) );
}
int main()
{
printf("%d\n",sumdig(123));
return 0;
}