i was trying a program with macros and wanted to throw compile time error. I resolved my program however on further studying i am confused with the use of logical operator. Please help me to understand this
for the following program with && operator output shown is "successfully Performed"
#include <stdio.h>
int main() {
int age=15;
#if (age>5) && (age>10) /*replace && with || and check for different combination of relational operator*/
#error cannot perform this operation
#endif
printf("successfully performed");
return 0;
}
the same output is produced if we replace (age>10) with (age<10). BUT if i use logical OR || operator this will throw the #error.
Why is this so? is it undefined behaviour of compiler?