Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- main(){
- int edad, mayores=0, menores=0;
- do{
- printf("Ingrese una edad: ");
- scanf("%i", &edad);
- if(edad>0 && edad<18){
- menores++;
- printf("Es menor. Hay %d menor/es y %d mayor/es.\n", menores, mayores);
- }else if(edad>=18){
- mayores++;
- printf("Es mayor. Hay %d menor/es y %d mayor/es.\n", menores, mayores);
- }
- }while(edad != 0);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement