Question
PLEASE HELP ME WITH PART 5 in C Language. The Code I have up to part 4 #include #include int A[40]; int fillArray(int low,int high)
PLEASE HELP ME WITH PART "5" in C Language.
The Code I have up to part 4
#include
#include
int A[40];
int fillArray(int low,int high)
{ //fills random array with one dimension
for(unsigned int i = 0; i
int newrand = low+(rand()% high);
A [i] = newrand;
printf("%i ", A[i]);
}
}
int findWithRange(int low, int high)
{ //finds with range of random array with one dimension
int Max = A [low] ;
for(unsigned int i = low; i
if (A [i] > Max ){
Max = A [i];
}
}return Max;
}
int reverseArray(int Array[])
{ // reverse elements with arra of one dimension
int reverse = 0;
for( unsigned int i = 0; i
int x = Array [i];
Array[i] = Array [40 -i-1];
Array [ 40-i-1] = x;
}
}
int findreverseWithRange (int Array [], int low, int high)
{ // find with range for reverse array with one dimension
for( unsigned int i = low; i
int x = Array [i];
Array[i] = Array [high -i-1];
Array [ high-i-1] = x;
}
}
int main()
{
int low,high;
printf("Pick a random low integer ");
scanf("%d", &low);
printf("Pick a random high integer ");
scanf("%d", &high);
fillArray (low,high);
int Max = findWithRange (0,40);
printf(" The max is %i " , Max);
printf("Original ");
for(unsigned int i = 0; i
printf("%i ", A[i]);
}
}
reverseArray ( A );
printf(" Reversed ");
for(unsigned int i = 0; i
printf("%i ", A[i]);
}
printf(" ");
findreverseWithRange ( A,0,10 );
for(unsigned int i = 0; i
printf("%i ", A[i]);
}
exit(0);
}
Instructions: .Be sure to document your code (add comments on top of each function). . In the comments add your name, date, course, homework number, and statement of problem. .Once you are done, upload your final solution through Blackboard. No need for input validation. Implement a program called ArrayslDDemo.c Stens: .It is up to you to choose what the return type should be. Be creative! Functions should not have pointers implementations. .Arrays1DDemo.c has the following function:s Partl [100 points]: (1-Dimensional Array Functions) 1. 120 points] Implement a function called fillArray that fills a one-dimensional array with random integers. Integers are picked in the range LOW to HIGH (inclusive.) Here is a demo of filling an array of 40 elements with integers in the range 0 and 100. 17 86 71 51 30 99 45 1 16 66 45 35 0 56 19 859 48 35 90 83 75 9 36 1416 0 38 53 57 60 61 5 61 79 81 52 30 2. 120 points] Implement a function called findWithRange that locates the largest element in a range of the same array. The range consists of the array cells indexed between indices LOW and HIGH, inclusive. Here is a demo where LOW 10 and HIGH-19 0 56 19 859 48 35 90 83 75 17 86 71 51 30 99 45 12 16 66 45 35 9 36 14 16 0 38 53 57 60 61 5 61 79 81 52 30 Max = 86Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started