C-#define .

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

The #define preprocessor directive is used to define constant or macro in program .


#define identifier value

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

    #define PI 3.14
    int main()
        int r;
        float area;
        printf("Enter the radious");
        printf("Area : %f",area);
        return 0;
    OUTPUT : Enter the radious : 2
             Area : 12.560000

In the above code i have define the PI as macro in this program .

Welcome to AndroidATPoint.

back image                     next image