BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute Exam CPA Topic 1 Question 85 Discussion

Actual exam question for C++ Institute's CPA exam
Question #: 85
Topic #: 1
[All CPA Questions]

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

#include

using namespace std;

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

{

enum state { ok, error, warning};

enum state s1, s2, s3;

s1 = ok;

s2 = warning;

s3 = error;

s4 = ok;

cout << s1<< s2<< s3;

return 0;

}

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Timothy
6 months ago
So, the correct answer is B) compilation error.
upvoted 0 times
...
Anika
6 months ago
I agree, the code will give a compilation error.
upvoted 0 times
...
Tammara
6 months ago
I think it will not compile because s4 is not declared.
upvoted 0 times
...
Hillary
7 months ago
B) compilation error
upvoted 0 times
...
Denny
7 months ago
What will happen when you attempt to compile and run the following code?
upvoted 0 times
...

Save Cancel