Dsa
Math
Easy
Product of Digits
Given a non-negative integer n, calculate the product of its digits. If the product is less than 10, return that number. Otherwise, continue multiplying the digits of the product until the result is a single-digit number.
Input Format:
A single line containing the integer n (0 <= n <= 10^6).
Output Format:
A single line with the final single-digit product.
Example:
Input:
38
Output:
6
Key concepts
mathdigitsproduct
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