DXC Technology Interview Question

Q. After Giving a scenario which loop is best if or while?