Ans:->
The program to pick up the largest number from any 5 row by 5 column matrix in C Language.
Program is as follows:--
#include<stdio.h>
int main()
{
int lnum[5][5], i, j, lnsf;
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++)
{
if (lnum[i][j]>lnum[i][j - 1])
lnsf = lnum[i][j];
lnum[i][j] = lnsf;
}
}
printf("\nThe largest number is : %d", lnsf);
return 0;
}
OUTPUT:---
Enter the number : 5
Enter the number : 8
Enter the number : 45
Enter the number : 6
Enter the number : 60
Enter the number : 17
Enter the number : 58
Enter the number : 24
Enter the number : 96
Enter the number : 36
Enter the number : 12
Enter the number : 10
Enter the number : 2
Enter the number : 37
Enter the number : 3
Enter the number : 6
Enter the number : 8
Enter the number : 4
Enter the number : 9
Enter the number : 589
Enter the number : 2
Enter the number : 69
Enter the number : 35
Enter the number : 123
Enter the number : 5
The Largest Number is : 589
0 Comments
If you want to give any suggestion regarding the post please feel free to Comment below-