Find Sum Of Digit For Given Value By User.
This problem will calculate the sum of all digit in the value give by user. #include<stdio.h> void main() { long long no,temp; int rem,sum=0; printf(“\n\tEnter 5 to 6 digit number “); scanf(“%lld”,&no); temp=no; //printf(“no=%ld”,no); do { while(temp!=0) { rem=temp%10; //// printf(“rem=%d\n”,rem); sum=sum+rem; temp=temp/10; } //printf(“\nsum… Read More »Find Sum Of Digit For Given Value By User.