CTS interview question

Write a program