#define N 7 #define ZERO 0 #define ONE 1 //--------------------------------------------------------------------------------------- // Exercise 1_2 // ------------ // // General : None. // // Input : None. // // Process : None. // // Output : None. // //--------------------------------------------------------------------------------------- // Programmer : Cohen Idan // Student No : 211675038 // Date : 27.10.2019 //--------------------------------------------------------------------------------------- void main(void) { int array[N][N] = { ZERO }; unsigned int counter, area = N * N, row, col; for (counter = ZERO; counter < area; counter++) { row = counter / N; col = counter % N; array[row][col] = (col >= row) * (col-row + ONE); } }