Reverse Diagnal of matrices

Write a C++ program that inputs a square matrix and reverse the contents of its diagonal values.
Example
{1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16}

output
{4 2 3 1
5 7 6 8
9 11 10 12
16 14 15 13}

Please help in getting a code i know how to add, subtract and multiply but i cannot seem to undersand how this works.
Start with a program that reads a square matrix and then prints it. Show that code.
All good programs start with a plan, maybe circle the elements, maybe arrows, pseudocode even.

So in answering @keskiverto maybe show how the affected elements move. There's a pattern of simple swaps on each line.

{
    1   2   3   4
    5   6   7   8
    9  10  11  12
    13 14  15  16
}

{
    4   2   3   1
    5   7   6   8
    9  11  10  12
    16 14  15  13
}


Topic archived. No new replies allowed.