*
***
*****
*******
*********
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int r,i,j;
cout<<"Enter the range:"<<endl;
cin>>r;
for(i=0;i<r;i++)
{
for(j=i;j<r;j++)
{
cout<<" ";
}
for(j=0;j<=i;j++)
{
cout<<"*";
}
for(j=0;j<i;j++)
{
cout<<"*";
}
cout<<"\n";
}
getch();
}
No comments:
Post a Comment