You are on page 1of 5

#include<iostream>

using namespace std;

void main()

int sald, may, men, mayn, menn, contp = 0, contn = 0, res, contparp = 0, contimparp = 0, contparn = 0, contimparn=0;

char rpta;

do{

do{

cout << "ingrese saldo:\t ";

cin >> sald;

if (sald == 0)

cout << "error al ingresar saldo";

} while (sald == 0);

if (sald > 0)

contp = contp + 1;

if (contp == 1)

may = sald;
men = sald;

else

if (sald > may)

may = sald;

else

if (sald < men)

men = sald;

else

contn = contn + 1;

if (contn == 1)

mayn = sald;

menn = sald;

else

if (sald > mayn)

mayn = sald;

else

if (sald < menn)

menn = sald;

}
if (sald>0)

if (sald == 0)

cout << "es neutro";

else

res = sald % 2;

if (res == 0)

contparp++;

else

contimparp++;

else

if (sald == 0)

cout << "es neutro";

else

res = sald % 2;

if (res == 0)

contparn++;
else

contimparn++;

do{

cout << "desea otra opreacion?";

cin >> rpta;

if (rpta != 'N' && rpta != 'n' && rpta != 'S' && rpta != 's')

cout << "error al ingresar respuesta";

} while (rpta != 'N' && rpta != 'n' && rpta != 'S' && rpta != 's');

} while (rpta == 'S' || rpta == 's');

cout << "el saldo mayor positivo es:" << may<<endl;

cout << "el saldo menor positivo es:" << men<<endl;

cout << "el saldo mayor negativo es:" << mayn<<endl;

cout << "el saldo menor negativo es:" << menn<<endl;

cout << "el saldo par positivo es:" << contparp << endl;

cout << "el saldo impar positivo es:" << contimparp << endl;

cout << "el saldo par negativo es:" << contparn << endl;

cout << "el saldo impar negativo es:" << contimparn << endl;
system("pause");