My only problem is the spacing..... to make it right.... i need to make it inverted pyramid pattern...
like this:
9 8 7 6 5 4 3 2 1
9 8 7 6 5 4 3 2
9 8 7 6 5 4 3
9 8 7 6 5 4
9 8 7 6 5
9 8 7 6
9 8 7
9 8
9
#include <iostream.h>
#include <string.h>
#include <conio.h>
main()
{
clrscr();
int num,n;
cout<<"enter:";
cin>>n;
num=0;
while (num !=n)
{
for(int i = n; i > num;--i)
{
cout << " " << i;
}
cout << endl<<" ";
if(num == 0)
cout<<" ";
++num;
}
getch();
}
this is my code and only thing that wrong is the spacing before the rows...