Fortran Do While Statement Javascript Interview Coding