uhm, i really need help on recursion problems, and the first problem before my assignment is me because i really dont know how to do it, or how to construct it successfully... this is my assignment:
a program that will read 10 integers,display them as inputted and in reverse order,
display the minimum and the maximum imput using the following functions:
void readA(int A[])
-a function that reads an array of integers
int minimum(const int A[],int low, int high)
-a recursive function that returns the minimum element in the array A
int maximum(const int A[], int low, int high)
-a recursive function that returns the maximum element in the Array A.
void displayA(const int A[], int low, int high)
-a recursive function that displays the element of array A
void displayrev(const int A[],int low,int high)
-a recursive function that displays the elements of the array A in reverse order
*uhm, and this is my nonsense code that i've done, and even me didnt know what it is doing, but for me, at least i've tried..:'(
#include<stdio.h>
#define inte 10
void readA(int A[]){
int A[inte];
printf("\nenter an integer : ");
scanf("%d",A[inte]);
}
void displayA(const int A[],int low, int high){
if(low<=high)
{
printf("%d",A[low]);
displayA(A,low+1,high);
}
}
void displayrev(const int A[], int low, int high){
if (a>=0)
printf("\nA[displayrev(a-1)]");
}
main(){
int A[inte];
printf("Enter the numbers AGAIN : ");
scanf("%d",A[inte]);
}
there are many things that i didn't have there, i just dont know how, that's why i need help, please help me...super thanks guys...