Skip to content

Instantly share code, notes, and snippets.

@mishin
Forked from akshay-kumar-goel/Trishul
Created October 29, 2017 21:36
Show Gist options
  • Save mishin/dc9d9165991d58c5910722cd042549d0 to your computer and use it in GitHub Desktop.
Save mishin/dc9d9165991d58c5910722cd042549d0 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");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment