Answers for "pygramid program in c"

C
0

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("\n");
	}
}
Posted by: Guest on May-01-2022

Code answers related to "C"

Browse Popular Code Answers by Language