Menu

[Solved]Please Use C Following Code Creates 2 Dimensional Array Contains Rows Uneven Sizes Fill C Q37065026

Please Use C++.

The following code creates a 2 dimensional array that containsrows of uneven sizes. Fill in the code to first print the contentsof the array and then print row sums and print column sums.

#include <iostream>
using namespace std ;

int main()
{
    int** TwoDimArray ;
    const int ROW_COUNT = 5 ;

    TwoDimArray = new int*[ROW_COUNT] ;

    for(int i1=0 , i2=1, k1=1;        i1<ROW_COUNT;    i1++, i2++ )
      {
         TwoDimArray[i1] =new int[i2] ;
          for( intj1=0 ; j1<i2 ; j1++ )
           {
               TwoDimArray[i1][j1] = k1++ ;
            }

    } //for

     //print contents of the 2 dimensionalarray

     //Print row sums

     //Print column sums

    return(0) ;
}

Output should be:

1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

1
5
15
34
65

25
28
28
24
15

Expert Answer


Answer to Please Use C++. The following code creates a 2 dimensional array that contains rows of uneven sizes. Fill in the code to… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *