Maximum of sum and product of digits
CodeChefOpen on judge ↗
Given a number N, the task is to print the maximum between the sum and multiplication of the digits of the given number until the number is reduced to a single digit. Note: Sum and multiplication of digits to be done until the number is reduced to a single digit. Let’s take an example where N = 19, 19 breaks into 1+9=10 then 10 breaks into 1+0=1. 1 is a single digit sum. Also, 19 breaks into 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