QUESTION 5: Write a C++ function called layers which takes an NxN int array (for some constant N} and populates the entries O.N’l as foll o The upper…