Created
April 28, 2023 12:58
-
-
Save devleesch001/f695abfd58e8741bece5d1ba5ae2a394 to your computer and use it in GitHub Desktop.
3 < 2 < 1 is true ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
printf("3 < 2 : %d\n", 3 < 2); | |
printf("2 < 1 : %d\n", 2 < 1); | |
printf("3 < 2 < 1 : %d\n", 3 < 2 < 1); | |
printf("\n"); | |
printf("3 < 2 : "); | |
if (3 < 2) { | |
printf("true\n"); | |
} else { | |
printf("false\n"); | |
} | |
printf("2 < 1 : "); | |
if (2 < 1) { | |
printf("true\n"); | |
} else { | |
printf("false\n"); | |
} | |
printf("3 < 2 < 1 : "); | |
if (3 < 2 < 1) { | |
printf("true\n"); | |
} else { | |
printf("false\n"); | |
} | |
printf("\n"); | |
bool r1 = 3 < 2; | |
bool r2 = 2 < 1; | |
bool r3 = 3 < 2 < 1; | |
printf("3 < 2 : %d\n", r1); | |
printf("2 < 1 : %d\n", r2); | |
printf("3 < 2 < 1 : %d\n", r3); | |
printf("\n"); | |
printf("pointer of 3 < 2 : %p\n", 3 < 2); | |
printf("pointer of 2 < 1 : %p\n", 2 < 1); | |
printf("pointer of 3 < 2 < 1 : %p\n", 3 < 2 < 1); | |
return 0; | |
} |
Author
devleesch001
commented
Apr 28, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment