Preprocessors


  1. C preprocessors can have compiler specific features.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    True


  1. What is #include <stdio.h>?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Preprocessor directive



  1. Property which allows to produce different executable for different platforms in C is called?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Conditional compilation is the preprocessor facility to produce different executable.


  1. Which of the following properties of #define is not true?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    #define can be made externally available.
    They obey scope rules.
    You can use a pointer to #define.



  1. What will be the output of the following C code?
    #include <stdio.h>
    #define MINIMUM 30
    #ifdef(MINIMUM)
    #define MAXIMUM 250
    #endif
    int main()
    {
    printf("%d %d\n", MAXIMUM, MINIMUM);
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Compilation Error

    main.c:3:11: error: macro names must be identifiers
    #ifdef(MINIMUM)
    ^
    main.c: In function ‘main’:
    main.c:8:27: error: ‘MAXIMUM’ undeclared (first use in this function); did you mean ‘MINIMUM’?
    printf("%d %d\n", MAXIMUM, MINIMUM);
    ^~~~~~~
    MINIMUM
    main.c:8:27: note: each undeclared identifier is reported only once for each function it appears in