Friday, July 31, 2009

How do you put this in C++ language?

"If c is more than 'max' and c is not equal to -99"





thx a lot, I will select the best answer in less than 2 days.

How do you put this in C++ language?
I think it depends to some extent on the compiler you use, but for the one I know so far, it would be said something like this:





If ( (c %26gt; max) %26amp;%26amp; (c != -99) );





the only part I'm not sure about is the %26amp;%26amp; as that might be "or", not "and"...I always mix them up
Reply:that makes NO sence at all!!! my answer may not be the best, but plz tell other people(and me too) what it means! that would help lots of other people. but thanx 4 the 2pt!
Reply:I agree with DonutGuy. The || (pipe) symbols are for "OR" and the %26amp;%26amp; are for "AND".
Reply:max%26lt;c%26lt;99





I've just started learning C++... and messed up compiling my very first program.
Reply:int t=((c %26gt; max) %26amp;%26amp; (c != 99))?1:0;





This will return 1 if condition holds true otherwise 0.


No comments:

Post a Comment