We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cda06d6 commit 2ccd6ceCopy full SHA for 2ccd6ce
8-main.c
@@ -0,0 +1,18 @@
1
+#include "main.h"
2
+/**
3
+ * main - check the code for
4
+ *
5
+ * Return: Always 0.
6
+ */
7
+int main(void)
8
+{
9
+ int array[5];
10
+ array[0] = 98;
11
+ array[1] = 402;
12
+ array[2] = -198;
13
+ array[3] = 298;
14
+ array[4] = -1024;
15
+ print_array(array, 5);
16
+ return (0);
17
+}
18
+
8-print_array
@@ -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(", ");
19
+ }
20
+ printf("\n");
21
0 commit comments