numero mayor y menor...

Publicado en por Angie te quiere...

calcular cuando ingresar numeros me dija al tiempo el numero mayor y menor.

#include
<iostream>

using namespace std;

int main ()

{

    int num,may,men,cantm;

      may=0;

      men=1000;

    cout<<"ingrese la cantidad de numeros"<<endl;

      cin>>cantm;

      while (cantm>0)

      {

            cout<<"ingrese nunmero"<<endl;

            cin>>num;

    if (num<men)

      {

            men=num;

      }

       if (num>may)

      {

            may=num;

      }

     cantm=cantm-1;

      }

      cout<<"el numero menor es"<<men<<endl;

      cout<<"el numero mayor es"<<may<<endl;

      system ("pause");

            return 0;

 

}

 

Publicidad
Para estar informado de los últimos artículos, suscríbase:
Comentar este post