Rod cutting problem

code: https://ide.codingblocks.com/s/576715

when I’m replacing cuts with i + 1 which is its value im not getting an answer (commented it out) please explain why this is happening

do it like this
(i+1), so that resultant will be n - i - 1 , by doing this

it’s resultant is n-i+1

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.