Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define symbolic constants MAX_ROW = 3; MAX_COL = 5; Write a sum function that takes a two dimensional array with MAX_ROW and MAX_COL as its

Define symbolic constants

MAX_ROW = 3;

MAX_COL = 5;

Write a sum function that takes a two dimensional array with MAX_ROW and MAX_COL as its row/column sizes. Sum adds all the elements in the array and returns the sum.

Write a main function that initializes a two dimensional array int numbers[ MAX_ROW ] [ MAX_COL ] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5}. Then it calls the sum function to find the sum of all the numbers in the array. It prints the sum to the user.

I need this with out pointers *. I turned it in and thought it would be ok but no pointers are not allowed.

#include

using namespace std;

//initialize the row and column sizes const int MAX_ROW = 3; const int MAX_COL = 5; //Sum function to add all the elements in the array and returns the sum to main function int sum(int *numbers, int MAX_ROW, int MAX_COL) { //Local variable declaration int i, j, sum = 0; for (i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions