Nagarro interview question

Write a programme to change the matrix table