C Programming Code Examples C > Pyramid Patterns Code Examples Equilateral Triangle Printing In C Equilateral Triangle Printing In C A triangle with all sides equal is called equilateral triangle. We shall now see how to print stars *, in equilateral triangle shape. #include <stdio.h> int main() { int n,x,y; n = 5; // number of rows. for(x = 1; x <= n; x++) { for(y = 1; y <= n-x; y++) printf(" "); for(y = 1; y <= x; y++) printf("* "); printf("\n"); } return 1; } procedure equi_triangle FOR x=1 to N DO FOR y=1 to N DO PRINT " " END FOR FOR y=1 to x DO PRINT "* " END FOR END FOR end procedure