// CS 1621 Fall 2005 // Example of C++ reliability problem due to ease with which a logic // error can be made by mistakenly using the assignment operator // rather than the comparison operator #include using namespace std; int main() { int num; cout << "Please enter a one or a two:"; cin >> num; if (num = 1) // Expression is legal but not what programmer intended cout << "You entered one" << endl; else cout << "You entered two" << endl; return 0; }