-
What is the output of this program?
#include
using namespace std;
#define Maximum 100
int main()
{
int n;
num = ++Maximum;
cout << n;
return 0;
}
-
- 100
- Compilation Error
- Runtime Error
- Garbage value
- None of these
Correct Option: B
Macro Preprocessor only replaces occurance of macro symbol with macro symbol value, So we can’t increment the value.
Compilation Error
In function 'int main()':
7:9: error: 'num' was not declared in this scope
3:21: error: lvalue required as increment operand
7:17: note: in expansion of macro 'Maximum'