C-#if .

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


The #if preprocessor is used to evaluate the constant or macro . if condition is true . It will execute the code .


Syntax

    #if condition
    statement
    #endif
    

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

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

Welcome to AndroidATPoint.

back image                     next image