1
/* Make a program that receives two integer values, one of lower limit and the other of upper limit. Its function must print all values in the closed range defined. */
int main()
{
int max, min, n;
scanf("%i %i", &max, &min);
n = max - min;
int vet[1000];
printf("valor max %i, e o valor min %i\n\n", max, min);
printf("os numeros entre o max e min sao:\n");
vet[1000] = funcao(max, min);
for(int i=0; i<n; i++){
printf("%i ", vet[i]);
}
return 0;
}
int funcao(max,min){
int vet[1000];
for (int i=0; max >= min; max--){
vet [i] = max;
i++;
if (max == min){
return vet;
}}}
You return vet but assign to an element of an array (an integer).
– anonimo