Program Code:
#include<iostream>
using namespace std;
int main()
{
for(int i=1;i<5;i++){
for(int j=0;j<3;j++)
cout<<" ";
for(int k=1;k<=i;k++)
{
cout<<"*";
}
cout<<"\n";
}
for(int m=5;m>0;m--)
{
for(int n=0;n<3;n++)
cout<<" ";
for(int l=0;l<m;l++)
{
cout<<"*";
}
cout<<"\n";
}
return 0;
}
Output:
.exe file |
No comments:
Post a Comment