#include <stdio.h> void print_arr( int *arr, int size) { for(int i=1; i<=size; i++) { printf("Element [%d] of array: %d \n", i, *arr); arr++; } } int main() { int arr[] = {10,20,30,40,50}; print_arr(arr,5); return 0; }Soww:ecruw.lautturi.com
output:
Element [1] of array: 10 Element [2] of array: 20 Element [3] of array: 30 Element [4] of array: 40 Element [5] of array: 50