Single source shortest path using BFS

I tried coding this problem but i am not getting the correct ans . I am unable to find where is the error in the code.

This is the link for the code:

Hey @srividhya_14
u forgot to add gr.addedge(0,3);