GGK Interview Question

Programs based on mainly logic