Question: Nested Loops [ a ] = 1 1 2 5 , [ b ] = 4 7 7 3 Given vectors [ a ] of

Nested Loops
[a]=
11
2
5
,[b]=
47
7
3
Given vectors [a] of size 3\times 1 and [b] of size 3\times 1, if choosing one element from each vector, there exist
3\times 3=9 combinations.
Design a nested loop to calculate and report the product of every combination. In each iteration, your
code needs to report the product and which two elements are used in that iteration to get this product
in the following format.
For example, in the first two iterations, your code should generate the following:
The product of a[1] and b[1] equals 517
The product of a[1] and b[2] equals 77

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!