Question: Sum of a two-dimensional array (sum.c) Definition : Suppose that myarray is a two-dimensional array with given elements: 2 4 6 1 2 3 3

Sum of a two-dimensional array (sum.c) Definition : Suppose that myarray is a two-dimensional array with given elements: 2 4 6 1 2 3 3 6 9 4 8 12 5 10 15 Write a program (main) that reads column number and then calculates sum of the given column while using given array and pointer definitions: int myarray[NUM_ROWS][NUM_COLUMNS]; int (*my_pointer)[NUM_COLUMNS]; where NUM_ROWS is the number of rows and NUM_COLUMNS is the number of columns. Expected output-1: Array has 3 columns. Enter a column number to calculate the sum of its elements: 1 The sum of elements is: 15 Expected output-2: Array has 3 columns. Enter a column number to calculate the sum of its elements: 2 The sum of elements is: 30 Expected output-3: Array has 3 columns. Enter a column number to calculate the sum of its elements: 3 The sum of elements is: 4

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 Chemical Engineering Questions!