I'm trying to create a program that uses 4 ifs to make the operation with the highest value and the lowest value in C ++, but every time a squeegee condition appears, could you help me? How do I solve it? Can I replace the 4 ifs with something? I'm using no prototypes because I declared the function before the main body so it works normally.
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
void valor_maior(void)
{
int a, b, c, d, e, valor_maior, valor_menor;
cout << "Digite o [A]: ";
cin >> a;
cout << "Digite o [B]: ";
cin >> b;
cout << "Digite o [C]: ";
cin >> c;
cout << "Digite o [D]: ";
cin >> d;
cout << "Digite o [E]: ";
cin >> e;
valor_maior == a;
if (valor_maior < b)
valor_maior = b;
else
if (valor_maior < c)
valor_maior = c;
else
if (valor_maior < d)
valor_maior = d;
else
if (valor_maior < e)
valor_maior = e;
cout << "Valor maior: " << valor_maior << endl;
cin.get();
return;
}
void valor_menor(void)
{
int a, b, c, d, e, valor_maior, valor_menor;
cout << "Digite o [A]: ";
cin >> a;
cout << "Digite o [B]: ";
cin >> b;
cout << "Digite o [C]: ";
cin >> c;
cout << "Digite o [D]: ";
cin >> d;
cout << "Digite o [E]: ";
cin >> e;
valor_menor = b;
if (valor_menor > b)
valor_menor = b;
else
if (valor_menor > c)
valor_menor = c;
else
if (valor_menor > d)
valor_menor = d;
else
if (valor_menor > e)
valor_menor = e;
cout << "Valor menor: " << valor_menor << endl;
cin.get();
return;
}