home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 10: University / CDAT10.iso / TUTORIALES / CursoC / ejemplos / elseif.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-26  |  380 b   |  16 lines

  1. /* Uso de la sentencia condicional ELSE...IF. */
  2.  
  3. #include <stdio.h>
  4.  
  5. main() /* Escribe bebé,niño o adulto */
  6. {
  7.    int edad;
  8.    printf("Introduce tu edad: ");
  9.    scanf("%d",&edad);
  10.    if (edad<1)
  11.       printf("Lo siento, te has equivocado.");
  12.    else if (edad<3) printf("Eres un bebé");
  13.    else if (edad<13) printf("Eres un niño");
  14.    else printf("Eres adulto");
  15. }
  16.