Output is not working as expected I have added the simulator link for the output.
Tell me where I am wrong?