C programming
C programming

Program to find largest element in 2D Array

Program to find largest element in 2D Array

C programming

Program to find largest element in 2D Array

#include<stdio.h>
int main()
{
    int r;
    printf(“Enter a number of row : “);
    scanf(“%d”,&r);
    int c;
    printf(“Enter a number of column : “);
    scanf(“%d”,&c);
    int  arr[r][c], max;
    printf(“Enter an element of array :\n “);
    for( int i=0; i<r; i++)
    {
        for( int j=0; j<c; j++)
            scanf(“%d”, &arr[i][j]);
    }
    max = arr[0][0];
    for(int i=0; i<r; i++)
    {
        for( int j=0; j<c; j++)
        {
            if(max<arr[i][j])
                max = arr[i][j];
        }
    }
    printf(“\nLargest Element of an array = %d”, max);
    return 0;
}
OUTPUT :
Enter a number of row : 3
Enter a number of column : 3
Enter element of array :
2 3 5
5 3 1
7 5 8
Largest element of an array : 8

 

Topics Covered :

  • largest element
  • find biggest element in array in c
  • c program to find largest element of array
  • find largest number in an array
  • find maximum element in array
  • c program to find maximum element in array
  • c program to find largest number in an array

 


 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin 

 

Leave a Reply

Your email address will not be published. Required fields are marked *