Created
March 24, 2016 14:47
-
-
Save jmramirezpro/4caa09259d73e8afb463 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Piramide.c | |
* Ejercicios del Podcast Codigo Fuente - Programa 27 | |
* Crear el programa asteriscos en el que se introduce un número entero y se | |
* crea una pirámide de asteriscos. Por ejemplo si se introduce el 6, | |
* el resultado sería como este: | |
* * | |
* *** | |
* ***** | |
* ******* | |
* ********* | |
* *********** | |
* Creado el 17 de mar. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
int main() | |
{ | |
int n,fila,col; | |
printf("Introduce el tamaño de la piramide: "); | |
scanf("%d",&n); | |
for(fila=1;fila<=n;fila++){ | |
for(col=1;col<=n-fila;col++){ | |
printf(" "); | |
} | |
for(col=1;col<=2*fila-1;col++){ | |
printf("*"); | |
} | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment