Write the DISPLAYARRAY function with two parameters TAB and N which displays N components of the array TAB of the type int.
Example:
The table T read in the previous exercise will be displayed by the call:
DISPLAYARRAY(T, N);
and will be presented as follows:
43 55 67 79
Difficulty level
Video recording
This exercise is mostly suitable for students
void DISPLAYARRAY(int TAB[], int N)
{
int i=0;
while (i<N)
{
printf("%d ", TAB[i]);
i++;
}
printf("\n");
}
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Delete duplicate elements in an array