#include<iostream.h> #include<conio.h> #include<iomanip.h> void main() { clrscr(); int i,j,s=5,p,k=2,t; for(i=0;i<=4;i++) { cout<<setw(s); for(j=0;j<=i;j++) { cout<<"*"; p=i; } if(j>1) { for(j=0;j<p;j++) cout<<"*"; cout<<endl; } else cout<<endl; s--; } for(i=3;i>=0;i--) { cout<<setw(k); for(j=i;j>=0;j--) cout<<"*"; for(j=i-1;j>=0;j--) cout<<"*"; cout<<endl; k++; } getch(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)