Cyber Monday 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
7 months ago
So, the correct answer is B) compilation error.
upvoted 0 times
...
Anika
7 months ago
I agree, the code will give a compilation error.
upvoted 0 times
...
Tammara
7 months ago
I think it will not compile because s4 is not declared.
upvoted 0 times
...
Hillary
8 months ago
B) compilation error
upvoted 0 times
...
Denny
8 months ago
What will happen when you attempt to compile and run the following code?
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77