What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int a=5;
cout << ((a < 5) ? 9.9 : 9);
}
Suggested Answer: A
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
4 comments · newest first
JU
Jules
3 days ago
I have a feeling there might be a compilation error, but I can't recall why exactly.
KA
Karan
8 days ago
I practiced a similar question, and I believe it compiles fine, so I'm leaning towards option A.
PA
Pamela
13 days ago
I'm not entirely sure, but I remember something about the ternary operator. Could it be that it prints 9.9?
KA
Kathryn
18 days ago
I think it should print 9 because a is not less than 5.