viernes, 30 de agosto de 2019

Programa 13

#include <iostream>
#include <stdio.h>


using namespace std;
int nacimiento [10],h,yearact,a,b,acum;
float promedio;

int main()
{
 for (h=0;h<=9;h++)
 {
     cout << "CAPTURA El AnO DE NACIMIENTO" << endl;
     cin >> nacimiento[h];
 }
    cout << "INGRESA EL AnO ACTUAL" << endl;
    cin >> yearact;

 for (h=0;h<=9;h++)

 {
     acum=acum+yearact-nacimiento[h];
 }
   promedio =acum/10;

  for (h=0;h<=9;h++)

  {
      if (yearact-nacimiento[h]>=18)
        a++;
      else
        b++;
  }
    cout << a << " Personas mayores de edad" << endl;
    cout << b << " Personas menores de edad " << endl;

   for (h=0;h<=9;h++)
        {
         if (yearact-nacimiento [h]>18)
          cout << "LA PERSONA " << h+1 << " ES MAYOR DE EDAD" << endl;

          else
            cout << "LA PERSONA " << h+1 << " ES MENOR DE EDAD" << endl;
        }


    return 0;
}



No hay comentarios.:

Publicar un comentario