Why I can't run the program after comparing maximum and minimum after each loops? What is the right way to do them?
int maxFee=0,minFee=100000, TpricePT3tax, TpriceSPMtax;
if (TpriceSPMtax > maxFee)
maxFee= TpriceSPMtax;
if (TpricePT3tax > maxFee)
maxFee = TpricePT3tax;
if (TpriceSPMtax < minFee)
minFee = TpriceSPMtax;
if (TpricePT3tax < minFee)
minFee = TpricePT3tax;
if (TpriceSPMtax > TpricePT3tax)
maxFee = TpriceSPMtax;
if (TpriceSPMtax < TpricePT3tax)
minFee = TpriceSPMtax;
if (TpricePT3tax > TpriceSPMtax)
maxFee = TpricePT3tax;
if (TpricePT3tax < TpriceSPMtax)
minFee = TpricePT3tax;
@Peter87 In the main program, there is if else statement. TpricePT3tax came from if, TpriceSPMtax came from else if. Let's say the first output I chose TpricePT3tax, it will update TpricePT3tax as the maximum and min=0. When I did the second loop and chose TpriceSPMtax, the total is higher and TpricePT3tax become lower so now the maximum is updated as Max= TpriceSPMtax, but the minimum should be updated as TpricePT3tax but it is now Min=0. noted: I've removed the last 4 if statement and we couldn't use the suggested coding from you as we didn't learned it in class.