int main()
{
int n,sum=0;
printf("Enter your Number");
scanf("%d",&n);
while(n!=0)
{
n=n%10;
sum=sum+n;
n=n/10;
}
printf("\n The Sum of Digits of Number You Entered is %d",sum);
}
OUTPUT
Enter your Number
56483126
The Sum of Digits of Number You Entered is 35
thanks,
Tushar Khoje
No comments:
Post a Comment