0
How is the result is "Sololearn" here? Could someone explain please?
#define SOLO 42 int main() { #if !SOLO printf("Try Again"); #else printf("SoloLearn"); #endif return 0; }
2 Answers
+ 4
When "SOLO" is replaced by 42, the condition !SOLO is evaluated to false since all non-zero values are considered to be true, thus the negation is false. As a result, only the code inbetween the #else and #endif directives is compiled, making the output "SoloLearn".
0
Thanks for effort Shadow