Infosys Interview Question

Basic DSA question about loop conditions