Skip to content

Instantly share code, notes, and snippets.

@IanCarloz
Created September 25, 2017 15:23
Show Gist options
  • Save IanCarloz/665432f7caec68ce062e368c170f143d to your computer and use it in GitHub Desktop.
Save IanCarloz/665432f7caec68ce062e368c170f143d to your computer and use it in GitHub Desktop.
#include <stdio.h>
/*
La instruccion while se utiliza para generar bucles (ciclos):
hasta satisfacer la condicion, un grupo de instrucciones se
ejecuta de forma repetida.
la forma general es:
while(condicion){instrucciones}
*/
int main(){
int digito, DigFinal;
printf("Dame un valor entero inicial ");
scanf("%i",&digito);
//digito = digito - 1;
printf("Dame un valor entero final ");
scanf("%i",&DigFinal);
//DigFinal= DigFinal - 1;
printf("Ahora te muestro una lista de datos:\n");
while (digito < DigFinal + 1) {
printf("%d\n",digito);
digito = digito+1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment