30.10 Answers to Chapter Questions

I l @ ve RuBoard

Answer 30-1: The statement (number =! 2) is not a relational equation, but an assignment statement. It is equivalent to:

 number = (!2); 

(Because 2 is nonzero, !2 is zero.)

The programmer accidently reversed the not equal !=, so it became =! . The statement should read:

 if (number != 2) 
I l @ ve RuBoard


Practical C++ Programming
Practical C Programming, 3rd Edition
ISBN: 1565923065
EAN: 2147483647
Year: 2003
Pages: 364

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net