Just look at the code, nothing to say #include<stdio.h>
#include<stdlib.h>//Because the system() function is used in the function
void init(int a[], int sz)//Initialize the array { int i; for (i = 0; i < sz; i++) { a[i] = 0; } } void empty(int a[], int sz)//Empty the array { int i; for (i = 0; i < sz; i++) { a[i] = 0; } } void reverse(int a[], int sz)//Inversion of array elements { int i=0; int tem=0; for (i = 0; i < sz/2; i++) { has = a[i]; a[i] = a[sz - i - 1]; a [sz - 1 - i] = tem; } } intmain() { int arr[3] = { 1, 2, 3 }; int i = 0; int sz = sizeof(arr) / sizeof(arr[0]); for (i = 0; i < sz; i++) { printf("%d", arr[i]); } printf("\n"); init(arr, sz);//Initialize the array for (i = 0; i < sz; i++)//print the initialized array { printf("%d", arr[i]); } printf("\n"); for (i = 0; i < sz; i++)//Restore the original array { arr[i] = i + 1; printf("%d", arr[i]); } printf("\n"); empty(arr, sz);//Empty the array for (i = 0; i < sz; i++) { printf("%d", arr[i]); } printf("\n"); for (i = 0; i < sz; i++)//Restore the original array { arr[i] = i + 1; printf("%d", arr[i]); } printf("\n"); reverse(arr, sz);//Invert the array for (i = 0; i < sz; i++)//print the inverse array { printf("%d", arr[i]); } system("pause"); return 0; }