Let's determine a t square matrix's column, which elements' sum, above the main diagonal, is the biggest! Any idea how i should start this in c++?
- 2 Contributors
- forum1 Reply
- 13 Views
- 11 Years Discussion Span
- comment Latest Post by Lerner
Lerner 582
A simple empty main() is always a good place to start!
Since this isn't a math or physics forum, by t square matrix do you mean a matrix with an evern number of rows and columns?
If so, and if you use notation similar to (0,0) to denote any given element of the matrix, where the first item is the row and the second is the column, then I assume the main diagonal would be elements where index equals the column index. In a 3x3 matrix that would be (0,0), (1, 1), and (2, 2) if the matrix were 0 indexed. Then the sum above that main diagonal would be the sum of (0,1) + (0, 2) + (1, 2). Is that right?
If so, then write a program to declare a dynamic 2 dimensional array of size t by t. Then add the ability to initialize each element to a given value. Then add the ability to display the 2D array in tabular form. If you get that far then hopefully from the work that far you can see what to do on your own. Post when you get into trouble with pertinent code segments with error messages (if any) and explanations.