Header Ads Widget

C PROGRAM: Program to pick up the largest number from any 5 row by 5 column matrix in C Language - Sparsh Blog

 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    



THANKU FOR READING THIS ARTICLE ON-

If you want to suggest any changes in the program please feel free to contact us in the comment section or you can reach us using Contact us Page.



Post a Comment

0 Comments