five-digit number is input through the keyboard, calculate the sum of its digits. i think my code is too long. can anyone help with other best way to get the same result as mine. thanks alot.
Code:#include<stdio.h> int main() { int number; printf("input five-digit number :\n"); scanf("%d",&number); printf("sum is %d\n",number/10000+(number%10000)/1000+(number%10000)%1000/100+(number%10000)%1000%100/10+(number%10000)%1000%100%10); }