String to integer problem

https://ide.codingblocks.com/s/69569
here is my code plz help me out with the output

@Dhruv-Miglani-2090236747707980 hey dhruv i have corrected your code you can refer this.

Hey Dhruv,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.