How to print arrow in C?

#include<stdio.h>
int main()
{
int i,j,k,n;
printf(“Enter your N”);
scanf(“%d”,&n);
for(i=1;i<=n-1;i++)
{
for(j=1;j<=n-i;j++)
printf(” “);

for(k=1;k<=i-1;k++)
printf(“*”);
printf(“\n”);

}
for(i=1;i<=n+n;i++)
printf(“*”);
printf(“\n”);
for(i=n-1;i>=1;i–)
{
for(j=1;j<=n-i;j++)
printf(” “);

for(k=1;k<=i-1;k++)
printf(“*”);
printf(“\n”);

}

}

Output of program-

Leave a Reply