Question: Write a method called logicAnd that accepts as parameters two arrays of integer (A and B) and returns another array of integer (C). C[i] =

Write a method called logicAnd that accepts as parameters two arrays of integer (A and B) and returns another array of integer (C). C[i] = 1 if B[i] divides A[i], otherwise C[i]=0. Write a test program (main) to declare and initialize two integer arrays of size entered by the user, invoke the method logicAnd, then display the array result. The program put the three arrays (A, B and C) in a 2-D array M as follow. Sample Run: Enter the size of the array: 5 Enter 5 numbers for A: 12 20 4 30 17 Enter 5 numbers for B: 3 6 24 15 9 The results: A 12 20 4 30 17

B 3 6 24 15 9

C 1 0 0 1 0

M 12 20 4 30 17

3 6 24 15 9

1 0 0 1 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!