Files
college-C/7/ex1_1.c
2022-02-25 15:33:16 +02:00

35 lines
932 B
C

#define N 7
#define ZERO 0
#define ONE 1
//---------------------------------------------------------------------------------------
// Exercise 1_1
// ------------
//
// 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) * (row + ONE);
}
}