A few things about your code:
1. Its always advisable to use standard headers. So replace
CODE
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
with
CODE
#include<iostream>
#include<iomanip>
Note that conio.h hasn't been declared. This is because it is a non-standard header file. You should remove all the
clrscr() its non-standard as well

.
2. Never use void main(). To see why
CLICK HERE. Use:
CODE
int main()
{
// code here
return 0;
}
3. This
[code]
cout<<" The entered matrix is..."<<"\n';
Should be
CODE
cout<<" The entered matrix is..."<<'\n';
Or you can replace
'\n' with
endl since you're using C++.
4. Lets look at your for loops individually,
CODE
for(i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
cout<<a[i][j]<<"\t";
}
}
You might want to go to the next line after each row. So add an
endl after the inner loop like this:
CODE
for(i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
cout<<a[i][j]<<'\t';
}
cout<<endl;
}
Now the next loop:
CODE
for(i=0; i<=n; i++)
{
for(j=0; j<=n; j++)
{
cout<<"\n";
cout<<a[i][j]<<"\t";
}
}
As jihaag said, you will have to put the '\n' in the outer loop to get one row per line (Note: I have used endl instead of '\n'). Secondly, in the two loops, you have used
i=0; i<=n; i++ and
j=0; j<=n; j++. Arrays have zero based indices in C++. So your condition should be
less than not less than or equal to. Lastly, since you want only the lower half, you have to see if the element is part of the lower half. Your code is printing the full matrix. Put a condition to see if (i>=j). Print only if this condition is true. With all this your loops become:
CODE
for(i=0; i<n; i++)
{
for(j=0; j<=n; j++)
{
if (i>=j)
cout<<a[i][j]<<' ';
}
cout<<endl;
}
Now your last loop.
CODE
for(int i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
cout<<"\n";
if(i<=j)
{
cout<<setw(5)<<a[i][j];
}
else
{
cout<<" ";
}
Remove the setw(5). That's one of the reason's why your output is weird. Instead put a space after a[i][j] is printed i.e.
cout<<a[i][j]<<' '. Put the '\n' in outer loop again. Lastly in your else construct, use
cout<<" ". Put two spaces in the quotes to make up for the space used in the previous cout. Hence:
CODE
for(int i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
if(i<=j)
{
cout<<a[i][j]<<' ';
}
else if(i>j)
{
cout<<" ";
}
}
cout<<endl;
}
Hope this helps

.