Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using swing, Write a program that displays a 10 by 10 square matrix. Each elemen

ID: 3564631 • Letter: U

Question

Using swing, Write a program that displays a 10 by 10 square matrix. Each element in the matrix is 0 or 1, randomly generated with a click of the Refresh button. Display each number centered in a text field. Use text field for each entry. Allow the user to change the entry value. Click the Find Largest Block button to find a largest square sub-matrix that consists of 1s. Highlight the numbers in the block using the red color

Using swing, Write a program that displays a 10 by 10 square matrix. Each element in the matrix is 0 or 1, randomly generated with a click of the Refresh button. Display each number centered in a text field. Use text field for each entry. Allow the user to change the entry value. Click the Find Largest Block button to find a largest square sub-matrix that consists of 1½s. Highlight the numbers in the block using the red color

Explanation / Answer

#include<conio.h>
#include<stdio.h>
void main()
{
int a[4][4],i,j,sum=0;
clrscr();
printf("enter 4*4 marks ");
for(i=0;i<4;i++)
{
for{j=0;j<4;j++)
{
scanf("%d.&a[i][j]);
}
}
for
(i=0;i<4;i++)
{
sum=sum+a[i][j];
}
printf("sum of diagonal1=%d,sum);
sum=0;
for(i=0;i<4;i++)
{
sum+sum+a[i][3-1];
}
printf(" sum of diagonal2=%d"sum);
getch();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote