#include <stdio.h>
int mxn(int *a)
{
for(int f=0; f<5; f++)
{
int m, n;
int max=0;
int min=0;
if(max>a[f])
{
max= a[f];
m=f;
}
if(min<a[f])
{
min = a[f];
n=f;
}
}
int m, n;
int *mp = &a[m];
int *np = &a[n];
return *mp;
}
int main() {
int a[5]={1, 2,3,4,5};
int * max;
int * min;
mxn(a);
printf("%p", *mxn(a));
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: