How flow of control is working in insertion sort

i want to know each and every flow of control in insertion sort , can we make this insertion sort through for loop

in 14th line code j-- means previously j value was 0 and now the value of j is -1 then how it will proceed… i want to know about the flow of control where it will go from 14th and 16th code

@vikash3303 ok wait will check and tell you

@vikash3303 when i=1 j=0 so while loop executes 1 time and j becomes -1 so while loop will not run and then line 16 happens is it okay?

in 13th line code the j value is 1 due to a[j+1] then how in 14th line its value will be -1 it should be 0, pls explain me…

@vikash3303 there’s a while loop j>=0 so when while loops end j becomes -1 thats how