21.Array to function
#include <stdio.h>
void arrFunc(int *a,int n)
{
for(int i=1; i<=n; i++)
{
printf("The value of %d is %d\n",i,*a);
a++;
}
}
int main()
{
//array to function
int arr[6] = {2, 5, 4, 35, 7, 8};
arrFunc(arr,6);
return 0;
}
Comments
Post a Comment