Displays the diagonal elements of a square matrix

What will be an ideal response?


```
void Matrix :: showDiagonal () const
{
if (rows == cols)
for (int i = 0; i < rows; ++i)
cout << setw(5) << i + 1 << setw(5) << mat[i][i] << endl;
else
cout << "Error -- Not a square matrix!!!" << endl << endl;

}

```

Computer Science & Information Technology

You might also like to view...

When you create a table you must specify a data type for each field. Please describe each of these data types: Date & Time, Number, AutoNumber, Yes/No.

What will be an ideal response?

Computer Science & Information Technology

Toggle buttons act in which of the following ways?

A) Click once to turn a feature on, right-click for the option to turn it off. B) Click once to turn a feature on, double-click to turn it off. C) Double-click to turn a feature on, Ctrl+click to turn it off. D) Click once to turn a feature on, again to turn it off.

Computer Science & Information Technology

A(n) ___________ is a segment of code that defines an action.?

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

- Public health is focused on the prevention and health of populations prior to illness

- Interact with both clinical and public systems - Integration across nations - Provide information that supports policy making - Successful vocabulary and messaging standards

Computer Science & Information Technology