Assignment
CodeChefOpen on judge ↗
A senior Student assigned Rahul a task to write the number of steps necessary to decrease an integer num to zero. Count the number of steps and output the number. **Conditions:** - If the current number is even, he must divide it by 2 in a single step; - if it is not, he must take 1 off it. ### Input - Input $n$ ### Output - Display the number of steps taken ### Constraints - $1 \leq num \leq
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