Im not getting correct o/p in this code

I have edited your code… Try to submit now…