fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int numero;
  5.  
  6. // Legge il numero inserito nell'input di Ideone
  7. if (scanf("%d", &numero) != 1) {
  8. // Se non inserisci nulla nell'input, usa 42 come test automatico
  9. numero = 42;
  10. }
  11.  
  12. if (numero % 2 == 0) {
  13. printf("Il numero %d e' pari.\n", numero);
  14. } else {
  15. printf("Il numero %d e' dispari.\n", numero);
  16. }
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5324KB
stdin
7
stdout
Il numero 7 e' dispari.