set stl Question 10

Last Updated :
Discuss
Comments

What is the output of the following code?

#include <iostream>
#include <set>

int main() {
  std::multiset<int> s {1, 2, 3, 3, 3, 4, 4, 5};
  std::cout << s.count(3) << std::endl;
  return 0;
}

3

2

5

8

Share your thoughts in the comments