C #else


If #if the condition is false then #else evaluates the expression or condition. It should be used with #if, #elif, #ifdef and #ifndef directives.


Syntax:

#if expression
//if code
#else
//else code
#endif

Example:

#include <stdio.h> 
#define N 1  
void main() {  
    #if (N==0)  
        printf("The Number value is Zero");  
    #else  
        printf("The Number value is Non-Zero");  
    #endif    
}   



OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.