Z By: Riyam Marjan 2D-ARRAY PROCESS

z By: Riyam Marjan

2D-ARRAY PROCESS

z

Revision

So far, you have learned how to create arrays (one- dimensional and 2 dimensional arrays) additionally, to that you have learned how to fill it with values.

Today , you are going to learn how to process these arrays and know more about main and second diagonal for Square array.

Ovz erview

Square arrays has two diagonal: main and second, you are able to deal with each one separately.

The main diagonal divides the array into two parts.

For Example

You have the following square array, it consist of 3x3.

The Main diagonal is

The second diagonal is

z

Learn more

How many rows and columns are there? What is the Main diagonal of the array? What is the Second diagonal of the array?

z

Example 1

Built the given 4x4 array. You have to set elements of the main diagonal equal to "1" ,elements above the main diagonal equal to "0" and set elements below that diagonal equal to 2.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download