Write while loop code (you cannot use for, although nested while loops are ok), which searches a two-dimensional int array ArrTwo to find ALL elements that are equal to zero (0), and print both indexes (row, column) of each zero once it is found. If there are no zeroes in the array, the code should print “Zero not found”. Each index pair (row,col) should be printed only once. * Note: This question is NOT asking you to write a method.
ANSWER:-
#include <iostream>
using namespace std;
int main() {
int m,n,i=0,j=0,count=0;
cout<<"enter the row and column : ";
cin>>m>>n;
int arr[m][n];
cout<<"enter the array elements : ";
while(i<m)
{
j=0;
while(j<n)
{
cin>>arr[i][j];
j++;
}
i++;
}
i=0;
j=0;
while(i<m)
{
j=0;
while(j<n)
{
if(arr[i][j]==0)
{
cout<<"("<<i<<","<<j<<")"<<endl;
count++;
}
j++;
}
i++;
}
if(count==0)
cout<<"Zero not found.";
return 0;
}
// OUTPUT

// If any doubt please comment
Write while loop code (you cannot use for, although nested while loops are ok), which searches...