Skip to content
Home » Pattern Programs in C for Half Pyramid

Pattern Programs in C for Half Pyramid

Learn about Pattern Programs in C for Half Pyramid in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

Pattern Programs in C for Half Pyramid

Program:

#include<stdio.h>
int main()
{
  int i,j;
  for(i=1;i<=5;i++)
  {
    for(j=1;j<=i;j++)
    {
      printf("* ");
    }
    printf("\n");
  }

  return 0;
}

Output:

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

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Codes :
Pattern Program 10 in C
Pattern Program 9 in C