Why is it not giving the correct output


minor changes were required. i commented the changes required. now it will work fine