LogiQuest
Back to STL
3

What will be the output of the program?

#include <iostream>
#include <string>
using namespace std;
#include <map>
int main() {
    map<string, int> m;
    m["b"] = 2; m["a"] = 1; m["b"] += 5;
    for (auto &p : m) cout << p.first << p.second << " ";
    cout << endl;
    return 0;
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.