Why will this not work?

one last problem then
1
2
3
4
5
6
7
8
9
10
11
if (result >= 0.5){
cout<<"you are too drunk to drive, you BAC is:"<<" "<<result<<endl;
cin.get();

}
else (result <0.5)
{cout << "you can drivee but be careful";
 }
 return 0;
}


will this work? also it cant compile because it says it expects a ";" before the {else
The else branch shouldn't have a condition.

Thank you :)
even with thecin.get()it still closes
Could you please post a preferably small, but compliable code which reproduces the problem?
if (result >= 0.5){
cout<<"you are too drunk to drive, you BAC is:"<<" "<<result<<endl;
cin.get();

}
else
{cout << "you can drive but be careful";
system(pause);
}

return 0;
}


this is the end of the program. so when i run the exe. and the result is bigger than or equal to 0.5 it works, but if its less than 0.5 it just close down.
Topic archived. No new replies allowed.