Why am I not getting correct output .Even though the logic is correct

Please help me how to solve this problem

hello @gvspraveen113
In ur code u are not taking input from user.

pls refer this code-> https://ide.codingblocks.com/s/236118