From df7914a88e010c358597ce0830aa87035cda6438 Mon Sep 17 00:00:00 2001 From: Louis Gallet Date: Sun, 8 Sep 2024 16:45:21 +0200 Subject: [PATCH] docs: :pencil: Create documentation --- Fundamentals/exos.c | 11 ++++++++++- README.md | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/Fundamentals/exos.c b/Fundamentals/exos.c index 50b3ff9..d0ba28d 100644 --- a/Fundamentals/exos.c +++ b/Fundamentals/exos.c @@ -10,7 +10,16 @@ int valeurMax(int tab[], int n); void additionMatrice(int matrice1[3][3], int matrice2[3][3], int resultat[3][3]); -void afficherMatrice(int matrice[3][3]); +void afficherMatrice(int matrice[3][3]) { + // This functions prints a 3x3 matrix in the console + for (int i = 0; i < 3; i++) { + printf("|"); + for (int j = 0; j < 3; j++) { + printf("%d ", matrice[i][j]); + } + printf("|\n"); + } +} void inverserChaine(char chaine[]); diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f63b26 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# AI Generated exam + +## Exercise 1: +Write a function that takes an integer N as a parameter and returns the sum of all even numbers from 1 to N. Use a for or while loop to go through the numbers and check if they are even. If so, add them to the sum. + +## Exercise 2: +Write a function that takes an integer N as a parameter and displays a triangle of size N. Use nested loops to manage the display of rows and columns. + +## Exercise 3: +Write a function that takes an array of integers array[] and an integer size (the size of the array). The function must return the maximum value of the array. Use a loop to go through all the elements in the array. + +## Exercise 4: +Write a function that takes two 3x3 matrices (two two-dimensional arrays) as parameters, and fills a third array resultat with the sum of the two matrices. Use nested loops to cycle through each element of the matrix. + +## Exercise 5: +Write a function that takes a string (char array) and inverts its contents. Use a loop to traverse the string, and a swap algorithm to invert the characters. + +## Exercise 6: +Write a function that takes a string of characters as a parameter and returns the number of vowels (a, e, i, o, u) it contains. Loop through each character in the string and check if it's a vowel. +