← All problemsSign in

Suppose you have '$' Cash, and want to buy chocolates for 'c' each. On going to the shop, the vendor offers you a deal that if you return him 'w' wrappers, he will give you a free chocolate. So, how many chocolates will you get in the end? Input First entry "$" ; amount of cash. Second entry "c" ; price of one chocolate. Third Entry "w" ; number of wrappers given for one free chocolate. O

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start