Using loops to populate an array.


My professor assigned this program, and I am so lost I don't even know where to start. Can someone please help me?

Here is what he assigned


Write the following program that creates and uses a loop to populate a one-dimensional array that holds the even numbers between 1 and 12; creates and uses a loop to populate a second one-dimensional array that holds the odd numbers between 1 and 12; creates a two-dimensional array that holds the values of the products of the two one-dimensional arrays. Example...the value of [0][0] in the two dimensional array should be the value of the [0] subscript in the even array multiplied by the [0] subscript in the odd array. The value of the [1][1] spot in the two dimensional array should be the value of the [1] subscript in the even array multiplied by the [1] subscript in the odd array. Output the values of the two dimensional array to the screen in an organized fashion so it is clear which values are which. Remember, you need to show as output the entire multiplication table...a total of 36 values. Also, please show the appropriate column headings and row headings.

2 4 6 8 10 12

1 2 4 6 8 10 12
3 6 12 18 24 30 36
5 10 20 30 40 50 60
7 14 28 42 56 70 84
9 18 36 54 72 90 108
11 22 44 66 88 110 132
For loop
If statement
Modulus operator will help in this scenario for separating even numbers
Else statement
Send the odd numbers to the array

That should get you going
Topic archived. No new replies allowed.