A program to find largest number from 5 row by 5 column matrix
I made the code that stores and prints 5 row by 5 column values but I have no idea how find the largest number from them.What should I do to find the largest number?If I use if-else then it would be very tedious but I think there is way out with for loop but still I can't frame the logic.
Here is the code
Code:
#include<stdio.h>
main()
{
int lnum[5][5];
int i,j;
for(i=0;i<=4;i++)
{
printf("\n");
for(j=0;j<=4;j++)
{
printf("Enter the number");
scanf("%d",&lnum[i][j]);
}
}
for(i=0;i<=4;i++)
{
printf("\n");
for(j=0;j<=4;j++)
{
printf("%d",lnum[i][j]);
}
}
getch();
}