// Think CS ch. 4 examples #include #include #include using namespace std; int main () { srand(time(NULL)); for (int i = 1; i <= 5; i++) cout << (double) rand() / RAND_MAX << endl; int X = 0; if (X = 0) { // note error! "=" instead of "==" cout << "It's zero\n"; } else { cout << "It's not zero\n"; } X = 6; if (X = 6) { cout << "It's zero\n"; } else { cout << "It's not zero\n"; } return 0; }