Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 23: Write a C++ program to print the left lower triangle of matrix.

#include<iostream>
using namespace std;

int main()
{
	int i,j,m1[3][3];
	cout<<"\nenter a matrix : \n";
	for(i=0;i<3;i++)
	{
		for(j=0;j<3;j++)
		{
			cin>>m1[i][j];
		}
	}

	cout<<"\nlower triangle of left : ";
	for(i=0;i<3;i++)
	{
		cout<<"\n";
		for(j=0;j<3;j++)
		{
			if(i>=(2-j))
			{
				cout<<m1[i][j]<<"\t";
			}
			else
			{
				cout<<" "<<"\t";
			}
		}
	}
	return 0;
}



If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.