First Upload

This commit is contained in:
2022-02-25 15:33:16 +02:00
commit 0c74d10f0d
295 changed files with 74784 additions and 0 deletions

36
7/ex2_1.c Normal file
View File

@@ -0,0 +1,36 @@
#define N 7
#define ZERO 0
#define ONE 1
#define TWO 2
//---------------------------------------------------------------------------------------
// Exercise 2_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] = (counter + ONE) + ((N - ONE - (TWO * col)) * (row % TWO));
}
}