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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started