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 7 Question 60 Discussion

Posted by Dean on Sep 27, 2026 at 09:38 PM

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.
0/2000 characters

Save Cancel