Skip to content

Instantly share code, notes, and snippets.

@akshay-kumar-goel
Created November 13, 2016 17:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save akshay-kumar-goel/a6576be151f029beb4a21232c16099b1 to your computer and use it in GitHub Desktop.
Save akshay-kumar-goel/a6576be151f029beb4a21232c16099b1 to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main()
{
int i,j,k;
int h=7,t=3,l=5;
for(i=1;i<=(t/2)+1;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
if(i==(t/2)+1)
{
for(i=1;i<=l+h-2;i++)
{
printf("*");
}
}
else
{
for(k=i+1;k<=((l+(t/2)+1));k++)
{ printf("-");
}
}
for(k=i;k<=h;k++)
{
printf("*");
}
printf("\n");
}
for(i=t/2;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("*");
}
for(k=i+1;k<=((l+(t/2)+1));k++)
{
printf("-");
}
for(k=i;k<=h;k++)
{
printf("*");
}
printf("\n");
}
}
@akshay-kumar-goel
Copy link
Author

if you want to see space please replace "-" with " ".

@akshay-kumar-goel
Copy link
Author

output
OUTPUT IS HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment