You are on page 1of 1

Pyramid 2

============================================
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int length;
int counter=1;
cout<<"Enter side Length: ";
cin>>length;
for (int i=length;i>=1;i--)
{
for (int j=i-1;j>=1;j--)
{
cout<<" ";
}
for (int k=1;k<=counter;k++)
{
cout<<"*";
}
cout<<endl;
counter=counter+2;
}
getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006