( 2 < 9 < 3 )
is evaluated as ( ( 2 < 9 ) < 3)
.
In the first step 2 < 9
is evaluated to be true, which is represented as integer value 1 and results in ((1) < 3)
for the second step.
That is obviously true.
You probably wanted something like ((x < val) && ( val < y))
.
More Related Contents:
- how to read .docx file in c [closed]
- How to work with a variable number of variables in C?
- What can I use for input conversion instead of scanf?
- Why does reading into a string buffer with scanf work both with and without the ampersand (&)?
- Why doesn’t getchar() wait for me to press enter after scanf()?
- What exactly is meant by “de-referencing a NULL pointer”?
- printf adds extra `FFFFFF` to hex print from a char array [duplicate]
- C — passing a 2d array as a function argument?
- call printf using va_list
- How to make a char string from a C macro’s value?
- Problems with C scanf(“%c”) function to read characters one by one
- Why does ‘fopen’ return a NULL pointer?
- get process name from process id (win32)
- Using fscanf() vs. fgets() and sscanf()
- Why, or when, do you need to dynamically allocate memory in C?
- Finding the address range of the data segment
- C pointers and arrays/ ‘sizeof’ operator [duplicate]
- Is fgets() returning NULL with a short buffer compliant?
- Varying string variable in an if condition
- Equivalents to MSVC’s _countof in other compilers?
- Cannot assign requested address – possible causes?
- how to bind raw socket to specific interface
- How to get position of right most set bit in C
- Why does wait() set status to 255 instead of the -1 exit status of the forked process?
- How to use S_ISREG() and S_ISDIR() POSIX Macros?
- Recommended way to track down array out-of-bound access/write in C program
- How to use lockdep feature in linux kernel for deadlock detection
- How can I flush unread data from a tty input queue on a UNIX system?
- ungetc: number of bytes of pushback
- Using Parentheses in Define Preprocessor Statements