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 CPP Exam - Topic 1 Question 32 Discussion

Posted by Helene on May 09, 2022 at 01:29 AM

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

#include

using namespace std;

int main()

{

cout.setf(ios::hex, ios::basefield);

cout<<100<<" ";

cout.unsetf(ios::hex);

cout<<100<<" ";

return 0;

}

Program outputs:

Suggested Answer: D

Get Premium CPP Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
7 comments · newest first
CA
Carla 11 months ago
Are you sure about that output? Sounds off.
JE
Jeff 12 months ago
Wait, why does it show hex for the first 100?
JA
Janey 12 months ago
Definitely not a compilation error!
DE
Delisa 1 year ago
I think it should be 100 0x64.
MA
Maurine 1 year ago
It outputs 0x64 0x64.
MA
Malcom 1 year ago
Alright, let's do this! I've worked with zpool before, so I'm feeling confident about this question. I'll go through the options and see which ones match the output.
JO
Jospeh 1 year ago
I'm pretty confident that option D is the way to go here. Manually setting the inventory to a high number seems like the simplest and most straightforward solution.
0/2000 characters

Save Cancel