Here the val should print the max number but its printing some address. When i tried to print while in loop, it printed the largest number but in the next line it again printed the address.
please tell me whats wrong.
Thanks
#include<stdio.h>
#include<conio.h>
int main()
{
int arr[5][5]={ 2,4,8,11,15,
6,8,5,8,7,
3,5,1,21,72,
28,95,62,8,2,
4,1,7,6,8};
int i,j,val;
val=arr[0][0];
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
if(val<arr[i][j+1])
{
val=arr[i][j+1];
}
else
{
continue;
}
}
printf("\n %d ",val);
getch();
}