I want to print a pyramid like this.....
*****
****
***
**
*
This is my code.....
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int i,j;
int b;
char* sp=" ";
cin>>j;
for(int a=j;a>=1;a--)
{ for( b=a;b>=1;b--)
cout<<"*";
cout<<endl;
for(int k=1;k<b;k++)
cout<<sp;
}
getch();
return 0;
}
But it does not print that pyramid.Please help.