Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute CPA-21-02 Exam - Topic 5 Question 51 Discussion

Actual exam question for C++ Institute's CPA-21-02 exam
Question #: 51
Topic #: 5
[All CPA-21-02 Questions]

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;

}

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

0/2000 characters
Maryanne
17 days ago
Totally agree, it's option B!
upvoted 0 times
...
Lenna
22 days ago
It prints: 0
upvoted 0 times
...
Royal
1 month ago
I feel like there might be a catch here, but I can't recall any specific rules that would cause a compilation error.
upvoted 0 times
...
Crista
2 months ago
I practiced a similar question where a macro was used, and it printed the defined value. So, I lean towards option B.
upvoted 0 times
...
Ena
2 months ago
I'm not entirely sure, but I remember something about macros in C++. Could it be a compilation error?
upvoted 0 times
...
Krystina
2 months ago
I think it should print 0 since DEF_A is defined as 0.
upvoted 0 times
...

Save Cancel