1/31/00
COM1100 Winter2000 Yuhong Yin
14
|| operator
nWhen the OR (||) is used with two simple expressions, the condition is satisfied if either one or both of the two expressions is true.
n(age > 40) || (term < 10)
nint x = 5, y =8;
n if ( ( x > 0) || ( (y –x) > 3 ) )
n cout << “Good Morning!” << endl;
n   else  
n cout << “Good Afternoon!” << endl;
n//will print: Good Morning!
n