Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Empty file added .github/workflows/test.py
Empty file.
Empty file added .github/workflows/tets.py
Empty file.
18 changes: 18 additions & 0 deletions 8-main.c
Original file line number Diff line number Diff line change
@@ -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);
}

21 changes: 21 additions & 0 deletions 8-print_array
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include<stdio.h>
#include<stdlib.h>

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