Hi expert,

I need to write a program, function one assigns the maximum and minimum values in intArray to the variables pointed by min and max respectively. The parameter size is the size of intArray.

Function two returns the smallest positive integer (greater than zero) found in intArray.Code:void findMinMax(int intArray[], int size, int* min, int* max)

The array parameter should be traversed only once to maximize the running efficiency ofCode:int findSmallestPositive(int intArray[], int size)

the function.

This is my script:

Am my code writing correctly? please told me my errorCode:#include <stdio.h> #include <limits.h> void findMinMax(int intArray[], int size, int* min, int* max) { size=2; if (min<max) { intArray[0]=min; intArray[1]=max; } else { intArray[0]=max; intArray[1]=min; } ; } int findSmallestPositive(int intArray[], int size) { size=2; if (intArray[0]<intArray[1]) return intArray[0]; else return intArray[1]; }