// Compiler : Dev-C++ 4.9.9.2
#include<stdio.h>
int main()
{
long num,temp,degit,sum=0;
printf("Number : ");
scanf("%ld",&num);
temp=num;
while(num>0)
{
degit=num%10;
sum+=degit;
num/=10;
}
printf("\n\nSum Of Degits %ld Is : %ld",temp,sum);
getch();
return 0;
}
Post a Comment