Answer:
Your solution is correct. Let me explain how it works so that it will be clearer for you
Step-by-step explanation:
Two constant values are defined for city and week
The 2D temperature array is declared taking the city as rows and week as columns, rows will hold the cities and columns will hold the temperature for the day of the city
A nested for loop is created to initialize all the elements in the array using cin function to assign values accordingly
When the first loop is done, another nested for loop is created to output the all the elements in the array