fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int numero;
  5.  
  6. // Solicitar al usuario que ingrese un número
  7. printf("Introduce un número entero: ");
  8. scanf("%d", &numero);
  9.  
  10. // Verificar si el número es negativo
  11. if (numero < 0) {
  12. printf("%d es negativo.\n", numero);
  13. }
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5264KB
stdin
1


stdout
Introduce un número entero: