Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0. Click for Solution
•  A ```#include #include #include void main() { int n,i=0,j,k,row,col; int a[4][4],b[4][4],flag[4][4]; clrscr(); printf("Enter no. of rows: "); scanf("%d",&row); printf("Enter no. of cols: "); scanf("%d",&col); for(i=0;i
•  A writing in very simple for all students in c............... ``` #include # include int main() { int arr[5][5]; int row,col; int i,j; printf("\nplease input the row and coloumns of the matrix::"); scanf("%d%d",&row,&col); printf("\nplease input the elements of the matrix::"); for(i=0;i
•  A ```import java.util.*; class array { int seti,setj,setflag=1; public static void main(String args[]) { Scanner sc=new Scanner(System.in); System.out.println("enter no of rows and columns"); int row=sc.nextInt(); int col=sc.nextInt(); int arr[][]=new int[row][col]; System.out.println("enter the elements"); for(int i=0;i"); for(int h=0;h"); for(int h=0;h ``` in java run it...
• b
```int i,j;
a[3][3]
for(int i=0;i<3;i  )
{
for(j=0;j<3;j  )
cin>>a[i][j]
```

 dheeraj kumar   wht is this 10 years ago

• R
```for (a=0;a<M;a++)
for (b=0;b<N;b++)
if(arr[a][b]==0)
{
i=0,j=0;
if(arr[a-1][b]!=0)
while(i<M)
{arr[i][j]=0;i++  }

if(arr[a][b-1]!=0)
while(j<N)
{arr[i][j]=0;j++ }
}
```

 PRAMOD YADAV   ati sunder 10 years ago

•  R ???
•  R if(m==0
[Insert Code]