triangulo
int i, j, n;
//i = filas
//j = columnas
int espacios, asteriscos;
/*
n: 5 espacios asteriscos
....*.... 4 1
*** 3 3
***** 2 5
******* 1 7
********* 0 9
espacios = de n - 1 a 0 de 1 en 1
asteriscos: de 1 a 2n - 1 de 2 en 2
*/
printf("\n");
n = 5;
espacios = n - 1;
asteriscos = 1;
for(i = 1; i <= n; i++){
//separamos la parte de las columnas dos partes: espacios y asteriscos
for(j = 1; j <= espacios; j++){
printf(" ");
}
for(j = 1; j <= asteriscos; j++){
printf("*");
}
espacios--;
asteriscos = asteriscos + 2;
printf("\n");
}
Also in C:
- root in C
- how to transfer textbox fro string to integer vb.net
- update os ubuntu terminal
- insert image material ui
- arduino digital io pins
- strncpy c
- pip install sklearn specific version
- is animal crossing for kids
- first person view unity
- es palindromo
- change text color c
- Write a interactive C program to find the MINIMUM array elements in a given 3X3 matrix.
- eeprom read arduinojson object
- markdown empty line
- triangulo
- print hello world in c
- print long in c
- what is string::npos
- arduino vscode upload choosing sketch
- is 33 prime number
- random en c
- 1 212 32123 4321234 543212345 in c
- c unused parameter
- check if audio is muted python