{ A destination to learn coding }

Pyramid Pattern

    *
   ***
  *****
 *******
*********

#include <stdio.h>
int main()
{
  int n,i,j,b;
  float k;

  printf("Enter the number of rows\n");
  scanf("%d",&n);
  b=n;

  for(i=0;i<n;i++)
  {
    for(j=0;j<(b-1);j++)
    {
      printf(" ");
    }
    b--;

    for(k=0;k<=i;k+=0.5)
    {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}