just like thet title says i need the sum of the array using recursion and it's not working .
int somme_elements(int t[10])
{ int static i = -1 ;
if (i<10)
{
i++;
return t[i] + somme_elements(t+1);
}
}
int main()
{
int t[10]={0} ; int i = 0 ;
/*saisie_tableau(t);/*
/*afficher_tableau(t);*/
printf("la somme des valeur du tableau t est %d ",somme_elements(t));
return 0;
}
the last printf is supposed to print the sum value . but it's always a really big number or just doesn't make any sense . thank you guys