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

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