1

I tried to use while (0 <= Height < 8) in my program but it didn't work. My program just keeps looping no matter what value I enter.

But it works when I use a Boolean expression in it. Like so while (0<=height&&height<8)

Does this mean that we cannot use int < x < int in C programming as the computer will get confused and we have to substitute this with Boolean expressions instead?

1 Answer 1

2

Does this mean that we cannot use int < x < int in C programming?

Yes. You cannot. As you've seen, the proper C syntax for that sort of boolean is:

height >= 0 && height < 8

for example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .