-
-
Save parzibyte/226b20b24f4f3cc15c7e68966a916320 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
#include <stdio.h> // Para printf y scanf | |
int main(void) { | |
double numero; // Aquí guardaremos el número que el usuario escriba | |
printf("Introduce un número:\n"); | |
// Leer el número, usar & para la dirección de memoria | |
scanf("%lf", &numero); | |
// Compararlo | |
if(numero == 0){ | |
printf("Neutro"); | |
}else if(numero > 0){ | |
printf("Positivo"); | |
}else{ | |
// Si no es neutro ni positivo, es negativo | |
printf("Negativo"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment