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
/* | |
* NumeroN2.c | |
* Ejercicios del Podcast Codigo Fuente - Programa 29 | |
* Escribir un programa que solicite de usuario un número N y luego muestre | |
* por pantalla la siguiente ejecución: | |
* 1 | |
* 1 2 | |
* 1 2 3 | |
* 1 2 3 4 | |
* ......... | |
* 1 2 3 4 5 6 ... N | |
* | |
* Creado el 14 de abr. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
int main(void) | |
{ | |
int N; | |
int i; | |
int j; | |
printf("Introduce un número: "); | |
if (scanf("%d",&N) < 1 ){ | |
printf("Error en la introducción del numero. "); | |
return (0); | |
} | |
for (i = 1; i <= N; i++){ | |
for (j = 1; j <= i; j++) | |
printf("%d ", j); | |
printf("\n"); | |
} | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment