#ifdef #ifndef #unfef

 1 #ifdef

#ifdef use and excusion in c

👇👇👇👇👇👇👇👇

//ifdef stand for "if define" and ifndef stand for "if not define"

// ifndef is just opposite of ifdef

#include <stdio.h>

#define INTEL

int main()

{

    #ifdef INTEL

printf("jo bhi statement ifdef and endif \

ke bich me he wo exculte ho ga");

#endif

    


    return 0;

}

2 #ifndef 

#ifndef use and excusion in c

👇👇👇👇👇👇👇👇👇


//if we remove comments than #else statement excuted

// but here #ifndef statement excute only

#include <stdio.h>

int main()

//#define INTEL

{

    #ifndef INTEL

    

printf("jo bhi statement ifndef and endif ke bich me he wo exculte ho ga");

//#else

//printf(" above statement not excuted ");

#endif

    


    return 0;

}

3 #undef

#undef use and excution in c

👇👇👇👇👇👇👇👇

//#undef stand for undefine it means the macro is not define or undefine


#include <stdio.h>

int main()

#define INTEL

{

    #ifdef INTEL

    

printf("jo bhi statement ifdef and endif ke bich me he wo exculte ho ga\n");

#else

printf(" above statement not excuted\n ");

#endif

    

    #undef INTEL

 #ifdef INTEL

 printf("jo bhi stamentt ifdef and endif ke bich me he wo excute ho ga\n");

 #else 

 printf("above statement of #undef is not define\n");

 #endif

    


    return 0;

}















Comments


  1. #include

    int main()
    {

    printf(" %s\n" , __FILE__);
    printf(" %d\n" , __LINE__);
    printf(" %d\n" , __func__);
    printf(" %s\n" , __DATE__);
    printf(" %s\n" , __TIME__);
    return 0;
    }

    ReplyDelete

Post a Comment

Popular posts from this blog

Factors : using C

Cross shaped pattern

Factorial ! calculation