// Soln3_4.cpp #include using std::cout; const int text = 0x01; const int binary = 0x02; const int read = 0x10; const int write = 0x20; const int append = 0x30; int main() { int mode = text | read; if (mode & text) cout << "mode is (text,"; else if (mode & binary) cout << "mode is (binary,"; if (mode & read) cout << "read)\n"; else if (mode & write) cout << "write)\n"; else if (mode & append) cout << "append)\n"; return 0; }