Siemens interview question

Asked to make a code & run