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

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
7/ex1_1 Normal file

Binary file not shown.

35
7/ex1_1.c Normal file
View 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);
}
}

35
7/ex1_2.c Normal file
View File

@@ -0,0 +1,35 @@
#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);
}
}

BIN
7/ex2_1 Normal file

Binary file not shown.

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));
}
}

BIN
7/ex2_2 Normal file

Binary file not shown.

50
7/ex2_2.c Normal file
View File

@@ -0,0 +1,50 @@
#include <stdio.h>
#define N 7
#define ZERO 0
#define ONE 1
#define TWO 2
//---------------------------------------------------------------------------------------
// Exercise 2_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 = ZERO,
col = ZERO;
for (counter = ZERO; counter < 49; counter++)
{
col = counter % 7;
row = counter / 7;
array[row][col] = counter + ONE;
array[col + 1][row] = 4 * (N - 1) - col;
}
for (int num = ZERO; num < N; num++)
{
for (int num2 = ZERO; num2 < N; num2++)
{
printf("%d, ", array[num][num2]);
}
printf("\n");
}
}