The #if preprocessor directive evaluates the expression or condition. If condition is true, it executes the code otherwise #elseif or #else or #endif code is executed.
Syntax with #else:
Syntax with #elif and #else:
C #if example
Let's see a simple example to use #if preprocessor directive.
Value of Number is: 0
Let's see another example to understand the #if directive clearly.
2 Value of Number is: 1
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week