Why my code is not giving me the correct answer

Hello @anshulgurawalia please check the code which you have shared.

sorry please consider this one

please respond i have mentioned a new code

@anshulgurawalia i am very very sorry for the delay actually there was some very bad network error.
you can check here: