Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 1, 2019 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/1e5e2c457b3aaa70a5239177e547d245 to your computer and use it in GitHub Desktop.
Save parzibyte/1e5e2c457b3aaa70a5239177e547d245 to your computer and use it in GitHub Desktop.
/*
Utilizar scanf para leer una variable entera en C
@author parzibyte.me
*/
#include <stdio.h>
int main(){
int numero; // Aquí alojaremos el valor leído
printf("Dime un número:\n");
scanf("%d", &numero); // Atención al operador &
printf("El número que pusiste es: %d", numero);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment