Created
August 1, 2019 15:23
-
-
Save parzibyte/beb0325540151af7cb2882be35f95db9 to your computer and use it in GitHub Desktop.
Escanear flotante con scanf en C - https://parzibyte.me/blog/2018/11/19/leer-datos-teclado-c-scanf/
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
/* | |
Utilizar scanf para leer una variable flotante en C | |
@author parzibyte.me | |
*/ | |
#include <stdio.h> | |
int main(){ | |
float numero; // Aquí alojaremos el valor leído | |
printf("Dime un número flotante:\n"); | |
scanf("%f", &numero); // Atención al operador & | |
printf("El número que pusiste es: %0.2f", numero); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment