1/18/00
COM1100 Winter2000 Yuhong Yin Northeastern University
20
if statement -- 4
nCondition also can simply be a variable
nif ( x ) // same as if ( x != 0 )
n result = sum / x;
nExamples
nint x = -5;
n if ( x )
n cout << “Good Morning !” << endl;
n else
n cout << “Good Afternoon !” << endl;
n
n