Server : Apache System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 User : apache ( 48) PHP Version : 8.0.28 Disable Function : NONE Directory : /var/www/html/venkat/old/ |
#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;
}