repl.it
C

No description

fork
loading
Files
  • main.c
  • main
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>

int main() {
int rows, star, spaces;
int number_of_stars = 6;
int number_of_rows = number_of_stars;

for (rows=1; rows <= number_of_rows; rows++) 
  {for (spaces=1; spaces <= number_of_stars; spaces++) 
  {
  printf(" ");
  }
for (star=1; star <= rows; star++) 
  {
  printf("*");
  printf(" ");
  }
  printf("\n");
  number_of_stars = number_of_stars - 1;
}
return 0;
}