Largest Number in 2D array / Matrix C program

Write a program accepts 25 numbers from user & stored in two dimensional array of size 5*5 and find the largest number amongst these numbers. This is a part of Mumbai University MCA Colleges C Program MCA SEM 1


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,a[5][5],k;
clrscr();
printf("Enter the number :\n");
for(i=0;i<5;i++)
{
scanf("%d",&a[i][j]);
for(j=-0;j<5;j++)
{
scanf("%d",&a[i][j]);
if(k<a[i][j])
{
k=a[i][j];

}
}
}
printf("The largest number is%d\n",k);
getch();
}

Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

No comments:

Post a comment