Exam4Training

What happens when you attempt to compile and run the following code?

What happens when you attempt to compile and run the following code?

#include <iostream>

using namespace std;

#define DEF_A 0

#define DEF_B DEF_A+1

#define DEF_C DEF_B+1

int main(int argc, char *argv[]) {

cout << DEF_C;

return 0;

}
A . It prints: 2
B . It prints: 10
C . It prints: 0
D . It prints: 1

Answer: A

Exit mobile version