Simple Pyramid Star Pattern
Simple Pyramid Star Pattern
star
pattern then there won't be much difficulty doing this. To make this pattern easy first of all lets ignore
the trailing spaces. If you ignore the trailing spaces the pattern would look like:
*
* *
* *
* *
*********
which is a normal hollow equilateral triangle star pattern. Here each row contains total 2*rownumber -
1 characters (including both inside spaces and stars). And here star only gets printed
when row=n or column=1 or column= (2*rownumber - 1) (where n is the total number of rows). And
inside spaces gets printed when stars don't.
Now, printing trailing spaces isn't difficult we just need to print n - rownumber spaces per row
(where n is the total number of rows to be printed).
/**
* C program to print hollow pyramid or hollow equilateral triangle star
pattern
*/
#include <stdio.h>
int main()
{
int i, j, n;
return 0;
}