A few problems off the bat:
- You don't need math.h, you aren't using any functions from there.
- This requires a square (i.e. 2-d) array/matrix.
- The user is to fill the entire matrix. Then you print the matrix with the data the user entered. Don't just print the number from 1 to n in whatever pattern you feel like.
- If you insist on using variable length arrays (VLAs), don't declare the VLA until after you have a valid value for the size of the array. Like I said in your other thread, you must read a value into n before you declare range[n]. Otherwise, you have an array of unknown size, which is bad.
Read your class notes, textbooks, online tutorials, etc on arrays, particularly 2-d arrays.
Study the assignment carefully. You are misunderstanding what it is asking. If you don't understand the problem, or can't solve it yourself with paper and pencil, then you can't program a computer to do it. Once you know how to solve it, come up with a rough plan (pseudo code perhaps), then implement that. Work in small steps, testing as you go. Don't move on to the next step until all previous steps are complete and work correctly. Thankfully your teacher already broke the problem down into 5 different steps for you. Work through the steps in the assignment one at a time. First, complete step 1, making your program do something simple like
Code:
Enter the size of the Latin square: 5
You want a Latin square of size 5
Then, on to step 2 (which you may combine with step 3, since they are very similar)
Code:
Enter the size of the Latin square: 2
You want a Latin square of size 2
Enter element [0][0]: 1
Enter element [0][1]: 2
Enter element [1][0]: 7
Enter element [1][1]: 8
The matrix you entered is:
1 2
7 8
Then work on steps 4 and 5.