Advertisement

previous boolean problem

Started by March 08, 2003 02:02 PM
3 comments, last by billy bob128 21 years, 8 months ago
ok it wouldnt let me reply to the last thread but hey. this is my program and no matter what the values are it always replies with true why? int y=5<7 and 5<4 print "true"
quote: Original post by billy bob128
int y=5<7 and 5<4
print "true"

I''m not sure what language you are using, but I think I know what your problem is. "if" What you are looking for is probably "if y=5<7 and 5<4" or something similar. It''s the difference between saying "it is eleven o''clock and I''m going to bed" and "if it is eleven o''clock I''m going to bed"
Advertisement
If this is c or c++, the two biggest errors that will make a statement always appear to be true is using = instead of ==, and adding a semicolon to the end of the if statement.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
thanks ive changed that but now theres a new problem thats not in the help menu its askin for a numeric value but it is a number what the hell is goin wrong with it?
don''t forget the square-brackets around the int!

This topic is closed to new replies.

Advertisement