# include <stdio.h>
/** Return max and position of maximum of table using pointers **/

void findMax(int *x,int n,int *posmax,int *max)
{
	int i;
	*posmax=0;
	*max=x[0];
	for(i=0;i<n;i++)
	{
		if(x[i]>*max)
		{
			*max=x[i];
			*posmax=i;
		}
	}
}

int main()
{
	int pm,m;
	int x[5]={7,8,10,22,11};
	findMax(x,5,&pm,&m);
	printf("Maximum %d %d \n",pm,m);
	return 0;
}
