C++ examples for Operator:Logical Operator
What is the value printed in the following program? Don't be misled by the assignment operators on each side of the ||
#include <iostream> using namespace std; int main()//from www .j a va2 s. c o m { int f, g; g = 5; f = 8; if ((g = 25) || (f = 35)) { cout << "g is " << g << " and f got changed to " << f; } return 0; }