//Downloaded From theonlinetutorials.com
//Source code
#include<iostream.h>
#include<conio.h>
int main()
{
int n,i,j;
cout<<"Enter an integer value below 200 :";
cin>>n;
for(i=0;i<n;i++)
{
for( j=0;j<i;j++)
cout<<" ";
cout<<"*";
for( j=1;j<=2*(n-i)-1;j++)
{
cout<<" ";
}
cout<<"*";
cout<<endl;
}
for(j=0;j<i;j++)
cout<<" ";
cout<<"*"<<endl;
for(i=n-1;i>=0;i--)
{
for( j=0;j<i;j++)
cout<<" ";
cout<<"*";
for( j=1;j<=2*(n-i)-1;j++)
{
cout<<" ";
}
cout<<"*";
cout<<endl;
}
getch();
return 0;
}
Not Satisfied ? Just search & get the result
Related posts:
