Hello!

Can you please help me understand these problem. I don't have any idea what is the supposed output.

Given a matrix M stored in array m[10][10]. Check if M is lower triangular, i.e. every element below the main diagonal is zero.

Recommended Answers

All 4 Replies

Can you be a bit more specific on what it is that you are having difficulty in understanding?

What is the output going to be..

Since it's not specified in your problem, anything really. For example:

double m[10][10];
.
.
if (triangular(m))// triangular could be a function that returns a bool(TRUE/FALSE).
cout<<"Matrix is triangular"<<endl;
else
cout<<"Matrix is not triangular"<<endl;

Lower triangular normally means that all the element above the diagonal are zero. I would clarify that first.

You are also going to have to be very careful about near zero errors if m is any of the floating point types. e.g. is 3.12e-312 not zero.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.