Help Chef to Find Digital Root
CodeChefOpen on judge ↗
The digital root (also called repeated digital sum) of a number is a single digit value obtained by an iterative process of summing digits. Digital sum of 65536 is 7, because 6+5+5+3+6=25 and 2+5 = 7. Write a program that takes an integer as input and prints its digital root. Constraints - 1 ≤ N ≤ 10^7 Example Input Output 65536 7 1214 8 3 3 9199999 1
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start