In the following program, implement the function
a. int *biggest(int *a, int count); This finds the largest element
in an array of integers.
#include <stdio.h>
#define SIZE 16
int* biggest(int *a, int count);
int main(void)
{
int values[16] = { 47, 17, 38, 91, 33, 24, 99, 35, 42,
10, 11, 43, 32, 97, 108, -8 };
int *p;
p = biggest(values, SIZE);
printf("the biggest element in the array is %i\n",
*p);
return 0;
}
int* biggest(int *a, int count)
{//[ADD YOUR CODE HERE]//
//I have done all the following but somithing must to be wrong!!!!//
int values[16] = { 47, 17, 38, 91, 33, 24, 99, 35, 42, 10, 11, 43, 32, 97, 108, -8 };
int i;
for(i=0; i<SIZE; i++);{
if((values[i]>=values[i+1]) && (values[i]>=values[i+2]) && (values[i]>=values[i+3]) && (values[i]>=values[i+4]) && (values[i]>=values[i+5]) && (values[i]>=values[i+6]) && (values[i]>=values[i+7]) && (values[i]>=values[i+8]) && (values[i]>=values[i+9]) && (values[i]>=values[i+10]) && (values[i]>=values[i+11]) && (values[i]>=values[i+12]) && (values[i]>=values[i+13]) && (values[i]>=values[i+14]) && (values[i]>=values[i+15]) && (values[i]>=values[i+16]))
count = values[i];
printf("values[%d]=%d\n",i,values[i]);
}
system("PAUSE");
}
}