Hi, I have a problem here with the c++ if statement.
if (adult=1)
{
hotel=(adult*hotel)+(children*0.5*hotel) +(baby*0);
break;
}
else if (adult=2)
{
hotel=(adult*260*0.85) +(children*0.5*260) +(baby*0);
break;
}
else if (adult>2)
{
hotel=(adult*hotel*0.8) +(children*0.5*hotel) +(baby*0);
break;
the above is a small part of the code i'm doing. Problem here is, It is changing my adult input to 1 no matter what digits i enter.
eg:
input for adult is 4
however, the statement (adult>2) is not carried out whereas it is carried out under (adult=1).
i displayed the 'adult' before and after the if statements. before, it is fine but after, it isn't.
Need help here, thanks :)