What is the problem in this code?

why I am getting wrong answer on submission. The code is giving correct output.

@2000bhaveshkumar Please save your code on ide.codingblocks.com and share its link.

Your logic seems correct. Just put an endl in line 34 after “No” and then check.