hello friends.
i have i simple c/c++ function that return the min of the array to the main function, in the body of the function i'm using an iterative loop so i would like to do it recursivly and i don't know from where to start! all reply are usefull thank you all Danifriends!
#include<stdio.h>
int minarr(int n, int *arr){
int i,min;
for(i=0; i<n; i++){
if(min > *(arr+i)){
min = *(arr+i);
}
}
return min;
}
int main(int argc, char const *argv[]) {
int n=10;
int tab[10]={7,5,6,8,7,4,8,9,2,3};
int min=minarr(n, tab);
printf("%d", min);
return 0;
}