Computer Science, asked by maninowpada6, 4 days ago

int arrl] = { 9, 18, 10, 9, 11 }; int cat[] = { 2, -1, 4, 2, 1 }; int n = 5; for (int i = 0; i < n; i = i + 1) { for (int j = 0; j < n; j = j + 1) { if (arr[i] % cat[j] == 0) { int temp = arr[j];​

Answers

Answered by Morriselasesino98
7

Explanation:

1 }; int n = 5; for (int i = 0; i < n; i = i + 1) { for (int j = 0; j < n; j = j + 1) { if (arr[i] % cat[j] == 0) { int temp = arr[j];

Answered by krishnaanandsynergy
2

The condition checks that if the element of the array names as arr is divisible by array named cat , it will store the element of the array named cat in a variable temp.

Explanation:

Given:-

Two arrays int arrl] = { 9, 18, 10, 9, 11 }; int cat[] = { 2, -1, 4, 2, 1 } and an integer n = 5.

To find:-

for (int i = 0; i < n; i = i + 1)

    for (int j = 0; j < n; j = j + 1)

          { if (arr[i] % cat[j] == 0)

                 int temp = arr[j];​

  • The given program has two loops in it.
  • The loops are iterating over both the arrays simultaneously.
  • The condition checks that if the element of the array names as arr is divisible by array named cat , it will store the element of the array named cat in a variable temp.

Similar questions