First Upload
This commit is contained in:
35
7/ex1_1.c
Normal file
35
7/ex1_1.c
Normal file
@@ -0,0 +1,35 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user