Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

pygramid program in c

				/* pattern
				 *
				***
			   *****
			  *******
				*/

# include <stdio.h>
int main()
{
	int row,space,stars;
	for(row = 1;row<=4;row++)
	{
		// it is to indicate and calulate each space in the pyramid
		for(space=1;space<=7-row;space++)
			printf(" ");
		for(stars=1;stars<=((2*row)-1);stars++)
			printf("*");
		printf("
");
	}
}
 
PREVIOUS NEXT
Tagged: #pygramid #program
ADD COMMENT
Topic
Name
4+3 =