fork download
  1. #include <stdio.h>
  2. int main() {
  3. int num;
  4.  
  5. printf("Introduce un número entero: ");
  6. scanf("%d", &num);
  7.  
  8. if (num < 0) { // Se verifica si el número es negativo
  9. printf("El número negativo es: %d\n", num);
  10. }
  11. // Si el número es positivo o cero, no se hace nada
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
Introduce un número entero: