I'm having a simple exercise where I need to make a pyramid using a repeat structure.
The pyramid has 17 columns and 9 rows.
My program displays it correctly, Is it possible to reduce some line or some for
?
#include <stdio.h>
#include <conio.h>
main()
{
int l,c,e;
for (l = 1; l <= 10; l = l + 1)
{
for(e=1; e<=(l-1);e = e + 1)
{
printf(" ");
}
for (c = 1; c <= 10-l; c = c + 1)
{
printf("*");
}
for (c = 2; c <= 10-l; c = c + 1)
{
printf("*");
}
printf("\n");
}
getch;
}