I implemented this but does not give output


Give the input and check now.