Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need this code converted so it does not have any pointers implemented #include #include int max(int m,int n,int array[m*n]) { int i,j,currentMax=array[0]; //To store current

Need this code converted so it does not have any pointers implemented

#include #include int max(int m,int n,int array[m*n]) { int i,j,currentMax=array[0]; //To store current maximum value for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { if(currentMax < array[i*n+j]) //Larger elements appears currentMax = array[i*n+j]; //update current maximum } } return currentMax; } void rowSum(int m,int n,int array[m*n]) { int i,j,sum; //To store total sum for (i = 0; i < m; ++i) { sum = 0; for (j = 0; j < n; ++j) sum = sum + array[i*n+j] ; //Add sum of every row element printf("Sum of row %d is %d ",i+1,sum); } printf(" "); } void columnSum(int m,int n,int array[m*n]) { int i,j,sum; //To store total sum for (j = 0; j < n; ++j) { sum = 0; for (i = 0; i < m; ++i) sum = sum + array[i*n+j]; //Add sum of every column element printf("Sum of column %d is %d ",j+1,sum); } printf(" "); } void isSquare(int m,int n,int array[m*n]) { if(m==n) //check whether number of rows and columns are same printf("This is a square array "); else printf("This is not a square array "); printf(" "); } void displayOutputs(int m,int n,int array[m*n]) { int i,j; printf("Here is your 2D array: "); 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_2

Step: 3

blur-text-image_3

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

1. Let a, b R, a Answered: 1 week ago

Answered: 1 week ago