MTW LABS interview question

Write the code for adding new elements dynamically?