c program to print patterns of numbers and stars | Printing Patterns of Stars and numbers in C | Star pyramids , triangles in C | C assignments to print pyramid of stars
#include
main()
{
int row, c, n, temp;
printf("Enter the number of rows in pyramid of stars you want to create");
scanf("%d",&n);
temp = n;
for ( row = 1 ; row <= n ; row++ )
{
for ( c = 1 ; c < temp ; c++ )
printf(" "); // to print space
temp--;
for ( c = 1 ; c <= 2*row - 1 ; c++ )
printf("*"); // to print star symbol in pyramid
printf("\n");
}
return 0;
}
Excuse me, how do we draw a flowchart for that?
ReplyDelete