What will be output of the program when you attempt to compile and run the following code?
#include
#include
#include
#include
using namespace std;
int main(){
int second[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };
string first[] = {"three", "four", "two", "one", "six","five", "seven", "nine","eight","zero"};
multimap
for(int i=0; i<10; i++) {
m.insert(pair
}
m[0]="ten";
m.insert(pair
for(multimap
cout<second<<" ";
}
return 0;
}
Suggested Answer: E
Get Premium CPP Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
6 comments · newest first
MA
Marleen
11 months ago
I'm pretty sure it's option C, but I'm not 100% convinced!
LE
Lenora
12 months ago
Wait, can you really assign like that in a multimap?
AN
Anna
12 months ago
I think the output will be "ten eleven two three four five six seven eight nine".
HA
Harris
12 months ago
Definitely not a compilation error, it's valid C++.
TA
Tawanna
1 year ago
Looks like a compilation error due to m[0] assignment!
GI
Gilbert
1 year ago
I remember learning about the MID Server in class, and I believe it uses port 445 for outbound connections. That's my best guess for this question.