Dsa
Math
Easy
Digital Root Calculator
Develop a program that calculates the digital root of a non-negative integer. The digital root is obtained by repeatedly summing the digits of the number until a single digit is achieved. The input consists of a single integer N (0 <= N <= 10^9) and the output should be that single digit.
Example:
Input:
9875
Output:
2
Key concepts
mathdigitroot
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now