Bank of America Interview Question

Write the programs