C Program to print Left Arrow in a star pattern Type 2
Program
#include<stdio.h>
void main()
{
int i, j, n;
printf("Enter number of rows:\t");
scanf("%d", &n);
for(i = 1; i < n; i++)
{
for(j = 1; j <= (n - i); j++)
{
printf(" ");
}
for(j = i; j <= n; j++)
{
printf("*");
}
printf("\n");
}
for(i = 1; i <= n; i++)
{
for(j = 1; j < i; j++)
{
printf(" ");
}
for(j = 1; j <= i; j++)
{
printf("*");
}
printf("\n");
}
}
Output
Enter number of rows: 5
*****
****
***
**
*
**
***
****
*****