Output error , not sure where i went wrong

i wrote the same program , but i m getting the output one less than the actual answer.

plz share the code

use ide.codingblocks.com to save your code and share the link

the errror which i can see is at line no 17
correct statement should be
ans= ans - inc;

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.