| Current Path : /var/www/html/bibhas.ghoshal/ITP_2019/lab/ |
| Current File : /var/www/html/bibhas.ghoshal/ITP_2019/lab/half_pyramid.c |
#include <stdio.h>
int main()
{
int i, j, row;
char c;
printf("Enter total number of rows for the pyramid : ");
scanf("%d", &row);
printf("Enter the character to use : ");
scanf(" %c", &c);
for (i = 1; i <= row; ++i) // loop for rows
{
for (j = 1; j <= i; ++j) // loop for columns
{
printf("%c ", c);
}
printf("\n");
}
return 0;
}