C-#else .

In this session i have discussed #else preprocessor in C .


The #if preprocessor is used to evaluate the constant or macro . if condition is false . It will come inside the #else part and execute the code .


Syntax

    #if condition
    statement
    #else
    statement
    #endif
    

Example : Write a program that demonstrate the use of #else preprocessor .

    #include<stdio.h>
    #define Number 19
    int main()
    {
        #if Number<=20
        printf("number is less");
        #else
        printf("Number is greater than 20");
        #endif 
        return 0;
    }
    
    OUTPUT : Number is greater than 20
    

Welcome to AndroidATPoint.

back image                     next image