Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active March 23, 2019 06:21
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/226b20b24f4f3cc15c7e68966a916320 to your computer and use it in GitHub Desktop.
Save parzibyte/226b20b24f4f3cc15c7e68966a916320 to your computer and use it in GitHub Desktop.
#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