I have a home assignment to write a short C++ program that would display an array of n columns and lines (square array) whose values would be distributed as follows:
I know it has to be two loops. What I don't know is the exact algorithm. I'm guessing it has something to do with the diagonal... But how do I program it to put the values as above?