Not getting output

https://ide.codingblocks.com/s/324130 please check my code

Hi, I am getting the output, can you please check again?

i am getting wrong output for the value of 5 i am getting distance of 5

check your graph, it is correct