Capgemini Interview Question

code for matrix question in c++