Array insertion sort

this is the code i am using and when i am printing my array it is printing one garbage value

hey
just a small error the
outer loop has to iterate form i = 0 ; i < n -1 ; i++

because we are assigning j = i+1 if the outer loop is from [0 , n] then j = n+1 which gives a garbage value