Output of the code

In reply to Nandakumari:

Hi,yes this will work but i want to understand why that code is giving the output 0.

Thanks.