We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sum of Digits of a Five Digit Number
Sum of Digits of a Five Digit Number
Sort by
recency
|
748 Discussions
|
Please Login in order to post a comment
Here is Sum of digits of a five digit number solution in c - https://programmingoneonone.com/hackerrank-sum-of-digits-of-a-five-digit-number-solution-in-c.html
include
include
include
include
int main() { int n; int sum = 0;
}
int main() {
}
int n; scanf("%d", &n); int sum=0; while(n>0) { sum+=n%10; n=n/10; } printf("%d",sum); return 0; }