Sum of Digits of a Five Digit Number | HackerRankTeam ATCSep 16, 20201 min readAsked: Anonymously | Category: C #include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { int n; scanf("%d", &n); int sum = 0; do { sum += (n % 10); n /= 10; } while(n != 0); printf("%d", sum); return 0; }
Asked: Anonymously | Category: C #include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { int n; scanf("%d", &n); int sum = 0; do { sum += (n % 10); n /= 10; } while(n != 0); printf("%d", sum); return 0; }
Small Triangles Large Triangles - HackerRank Solution in C | AskTheCodeYou are given n triangles, specifically their sides ai, bi & ci. Print them in the same style but sorted by their areas from the smallest...
David is fighting Goliath (again) - MOOC assignment from Edx solutionWrite a program that takes several lines of input from a user (see the below example). The first line of the input indicates the number ...
Comments