#include<stdio.h>
int main()
{
int n,
a, sum=0;
printf( "Enter a integer number: "
);
scanf( "%d" ,
&n);
while(n%10!=0)
{
a=n%10;
n=n/10;
sum=sum+a;
}
printf( "\nSum of the digit: %d" ,
sum);
return
0;
}
|
No comments:
Post a Comment