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.