C Program to print Left Arrow in a star pattern Type 1

Program

#include<stdio.h>
void main()
{
	int i, j, k, num;
	printf("Enter number of rows:\t");
	scanf("%d", &num);
	for(i = -num; i <= num - 1; i++)
	{
		k = i;
		if(k < 0)
			k = k * -1;
		for (j = 0; j <= num - 1; ++j)
		{
			if(j < k)
				printf("  ");
			else
				printf("*");
		}
	printf("\n");
	}
}

Output

Enter number of rows:   5
        *
      **
    ***
  ****
*****
  ****
    ***
      **
        *