In the previous problem you wrote a matrixAdd1 function that adds 1.0 to each el
ID: 3653523 • Letter: I
Question
In the previous problem you wrote a matrixAdd1 function that adds 1.0 to each element of a matrix. Now imagine you are writing part of the main program, and your goal is to call this function... In particular, assume a matrix named data has been declared for you in main() to be of size NxN, and that it is already filled with values. Write a *CODE FRAGMENT* to call matrixAdd1 to add 1.0 to every element of data, and then output the first and last elements of the data matrix to the console, separated by a comma (e.g. "11.2, 99.38").Explanation / Answer
int N; void matrixAdd1(double &matrix1 int N) // using referance { ;// initialized the matrix with proper values int i,j; for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.