Line 6 does nothing, assuming arr[] is even defined.
You're going to have to write a function that tests if an array is all zeroes.
1 2 3 4 5 6 7
bool array_is_null (int arr[], size_t sz)
{ for (int i=0; i<sz; i++)
{ if (arr[i] != 0)
returnfalse; // No point in checking further
}
returntrue; // All entries zero
}
Then you can change line 11 as follows (assuming you want to continue until both arrays are null):
while (! (array_is_null(arr1,5) && array_is_null(arr2,5)));