Unified Infotech Interview Question

About some logic based