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
|
753 Discussions
|
Please Login in order to post a comment
Nice little warm-up! A great way to brush up on basic input handling and digit manipulation. Dental clinic in saskatoon
int main() {
}
int main() { int n, sum; scanf("%d", &n); while (n>0) { int temp = n%10; sum+=temp; n/=10; } printf("%d", sum); }
include
include
include
include
int main() {
}