Write a program to create mark sheet using 2D array.

#include<conio.h>
#include<stdio.h>
int main()
{
int marks[5][3],i,j,max;
printf("enter marks of five students");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("\nenter the marks of %d student's %d subject",i,j);
scanf("%d",&marks[i][j]);
}
}
max=marks[0][0];
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
if(max<marks[i][j])
max=marks[i][j];
}
printf("\n%d",max);
}
}

No comments:

Post a Comment