Getting wrong output

https://ide.codingblocks.com/s/224445.Please check it.

hello @Hk199977,
your output is correct for the given graph.

0 – 1 – 2 – 3 – 4 – 5

this is your graph and shortest distance
from 0 -> 0 =0
from 0 -> 1 =1
from 0 -> 2 =2
from 0 -> 3 =3
from 0 -> 4 =4
from 0 -> 5 =5

your code is also printing same .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.