Preprocessor


  1. What is the output of this program?
    #include 
    using namespace std;
    #define Minimum(n,m) (((n)<(m)) ? n : m)
    int main ()
    {
    float f1, f2;
    f1 = 211.25;
    f2 = 211.025;
    cout <<"The minimum is " << Minimum(f1, f2) << endl;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In this program, we are getting the minimum number using conditional operator.


  1. What is the mandatory preprocessor directive for c++?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    For a c++ program to execute, we need #include.



  1. How many types of macros are there in c++?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    There are two types of macros. They are object-like and function-like.


  1. Which symbol is used to declare the preprocessor directives?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    # symbol is used to declare the preprocessor directives.



  1. which keyword is used to define the macros in c++?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    #define