Advertisement
clari-g

junio-ej2

Jul 15th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. main(){
  4.  
  5. int edad, mayores=0, menores=0;
  6.  
  7. do{
  8.     printf("Ingrese una edad: ");
  9.     scanf("%i", &edad);
  10.     if(edad>0 && edad<18){
  11.         menores++;
  12.         printf("Es menor. Hay %d menor/es y %d mayor/es.\n", menores, mayores);
  13.     }else if(edad>=18){
  14.         mayores++;
  15.         printf("Es mayor. Hay %d menor/es y %d mayor/es.\n", menores, mayores);
  16.     }
  17.  
  18. }while(edad != 0);
  19.  
  20. getch();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement