Skip to content
Home » Pyramid Star Pattern in C

Pyramid Star Pattern in C

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

Pyramid Star Pattern in C

Program:

#include<stdio.h>
int main()
{

  for(int i=1;i<=5;i++)
  {
   
    for(int 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 :
Pascal Triangle in C using 2d Array
Pascal Triangle Program in C Without Using Array in center of screen