Read a 5 X 5 two-dimensional array from an external data file. The data is store
ID: 3644316 • Letter: R
Question
Read a 5 X 5 two-dimensional array from an external data file. The data is stored in rows. Print out the original matrix. Then, you are to find the total of each row and column, store them into the sixth positions in your matrix. Finally print out your new 6 X 6 matrix which includes the totals.Sample Output:
Original Matrix
45 67 89 12 -3
-3 -6 -7 -4 -9
96 81 -8 52 12
14 -7 72 29 -1
19 43 28 63 87
With Totals
45 67 89 12 -3 210
-3 -6 -7 -4 -9 -29
96 81 -8 52 12 233
14 -7 72 29 -1 107
19 43 28 63 87 240
171 178 174 152 86 761
Explanation / Answer
#include "stdafx.h" #include #include using namespace std; void main() { int i,a[5], b[5],c[5]; for(i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.