What happens when you attempt to compile and run the following code?
#include
using namespace std;
#define DEF_A 0
int main(int argc, char *argv[]) {
cout << DEF_A;
return 0;
}
Suggested Answer: B
Get Premium CPA-21-02 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
12 comments · newest first
TR
Trinidad
3 months ago
Definitely not a compilation error. It should run fine.
RE
Rex
3 months ago
Yeah, DEF_A is defined as 0.
PA
Paris
3 months ago
I think it prints: 0.
LA
Lanie
3 months ago
I thought it might be a compilation error at first!
KR
Krystal
3 months ago
No compilation error here, just a simple output.
EL
Elbert
4 months ago
Wait, how can it print 1? That doesn't make sense.
MA
Maryanne
5 months ago
Totally agree, it's option B!
LE
Lenna
5 months ago
It prints: 0
RO
Royal
6 months ago
I feel like there might be a catch here, but I can't recall any specific rules that would cause a compilation error.
CR
Crista
6 months ago
I practiced a similar question where a macro was used, and it printed the defined value. So, I lean towards option B.
EN
Ena
6 months ago
I'm not entirely sure, but I remember something about macros in C++. Could it be a compilation error?
KR
Krystina
7 months ago
I think it should print 0 since DEF_A is defined as 0.