Code not running as expected

I am not getting the desired functionality as I am getting some error. Please have a look.

Code Link: https://ide.codingblocks.com/s/674332