Which of the following lines contain errors?

int main() {
    #define MyConst 1
    int k = MyConst + 1; //1
    #undef MyConst       //2
    k += MyConst;        //3
    #define MyConst 2    //4
    k = MyConst++;       //5
    return 0; 
}
Explanation
Line 3 - MyConst is undefined here. Definition was abolished in Line 2.
Line 5 - value of a constant cannot be changed.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback