diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e751ec5 Binary files /dev/null and b/.DS_Store differ diff --git a/.github/workflows/test.py b/.github/workflows/test.py new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/tets.py b/.github/workflows/tets.py new file mode 100644 index 0000000..e69de29 diff --git a/8-main.c b/8-main.c new file mode 100644 index 0000000..bb92156 --- /dev/null +++ b/8-main.c @@ -0,0 +1,18 @@ +#include "main.h" +/** + * main - check the code for + * + * Return: Always 0. + */ +int main(void) +{ + int array[5]; + array[0] = 98; + array[1] = 402; + array[2] = -198; + array[3] = 298; + array[4] = -1024; + print_array(array, 5); + return (0); +} + diff --git a/8-print_array b/8-print_array new file mode 100644 index 0000000..75ae3b8 --- /dev/null +++ b/8-print_array @@ -0,0 +1,21 @@ +#include +#include + +/** +* Write a fnction who printed N elements of an array +** @array: pointer to the array +* @size: size of the array +* @n: number of elements to print +*/ +void print_array(int *a, int n) +{ + int i; + + for (i = 0; i < n; i++) + { + printf("%d", a[i]); + if (i < n - 1) + printf(", "); + } + printf("\n"); +}