Siemens Interview Question

Write program for some suitation