how to display user input into 4 by 4 array? C++

  c++

I have this

printf("Enter the numbers from 1 to 16, in any order : ");
scanf_s("%f");

i want to display the output in order from his output but into 4×4 array like so

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

I’m thinking of putting a n after every 4th input and then printing each line. i also want to numerate each number so i can add up the totals of each row, column and diagonal.

Source: Windows Questions C++

LEAVE A COMMENT