Friday 10 October 2014

C++ Left Lower Pattern Staric Traingle nested loop program

void main()

{

int size=3;
cin>>size;
int margin_space;
int row=size;
while(row>=0)
{
margin_space = size - row;
int col = 0;
while(col<margin_space)
{
cout<<" ";
col = col+1;
}
int starics = row;
while(starics>=0)
{
cout<<"X";
starics--;
}
cout<<endl;
row--;
}

}



output:-