#include <stdio.h>
     #include <conio.h>

     int main(void)
      {
      int mat[5][5],i,j,
      c[5],d[5],
      max[5]={0,0,0,0,0},min[5]={0,0,0,0,0};
   /****************************************************/
      textcolor(15);
      clrscr();
      printf("Please enter the matrix:");
      for (i=0;i<5;i++)
      {
      for (j=0;j<5;j++)
      {
      printf("mat[%d][%d]:",i,j);
      scanf("%d",&mat[i][j]);
      if(mat[i][j]>max[i]){max[i]=mat[i][j];c[i]=j;}
      }
      printf("now max is :%d\n in % d ",max[i],c[i]);
      }
      printf("\n");
      getch();
   /***********************************************************/
     textcolor(11);
     clrscr();
     for (i=0;i<5;i++)
     {
     for (j=0;j<5;j++)
     {
     printf("%5d",mat[i][j]);
     }
     printf("\n");
     }
     printf("\n");
     for (i=0;i<5;i++)
     {
     printf(" max[%d]:%d ",i,max[i]);
     }
     getch();
   /******************************************************/
   for(i=1;i<5;i++)
   {
   if(c[i]==d[i]){printf("%d %d in %d %d ", mat[c[i],d[i]]),c[i],d[i]);
   }
   /******************************************************/
   return 0;
   }