Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/old/
Upload File :
Current File : /var/www/html/venkat/old/max.c

#include<stdio.h>
int* matrix(int*);
int main()
{
	int i,j;
	int a[2][2];
	int* p;
	printf("enter the matrix:\n");
	for(i=0;i<2;++i)
	{
		printf("enter the values in the %dth row:\n",(i+1));
		scanf("%d %d",&a[i][0],&a[i][1]);
	}
	p=matrix((int*)a);
	printf("the max of the matrix is %d:\n",*p);
	return 0;
}
int* matrix(int* x)
{
	int i;
	int* max=x;
	for(i=0;i<4;++i)
	{
		x=x+1;
		if(*x>*max)
			max=x;
	}
	
	return max;
}