Lab Ex Ch4 Array
Lab Ex Ch4 Array
Lab Ex Ch4 Array
Chapter 4 3
Lab Ex Ch4 – Array (2D)
5. Write a C++ program that read and adds equivalent elements of
the two-dimensional arrays named first and second. The program
should print the resulting data elements in table form.
6. Suppose indices represent people and that the value at row i, column j of
a 2D array is true just in case i and j are friends and false otherwise.
Initialize the 2D array to represent the following configuration. Then the
program counts how many pairs of friends are represented in the array.
Note that each friendship pair appears twice in the array, so in the
example above below there are 6 pairs of friends.
Chapter 4 4