LTM Limited interview question

Program on string concatenation logic.