Home » C++ Programming » Questions and Answers » Question
  1. What will be the output of these two programs?
    (i)
    #ifndef Example_H
    #define Example_H
    int n = 251;
    #endif

    (ii)
    #include 
    #include "Example.h"
    using namespace std;
    int main(int argc, char * argv[] )
    {
    cout << num++;
    return 0;
    }
    1. 252
    2. 251
    3. Compilation Error
    4. Runtime Error
    5. None of these
Correct Option: B

In this program, we have created a header file and linked that into the source program and we post incrementing that because of that it is printed as 251.



Your comments will be displayed only after manual approval.