1.

What is the use of count() function in bitset?(a) To count the number of 0’s(b) To count the number of 1’s(c) To count the number of total bits in a bitset(d) To count the number of low bitsThis question was posed to me in an online interview.I'd like to ask this question from Bitset topic in section Class Hierarchies, Library & Containers of C++

Answer»

Right choice is (B) To COUNT the number of 1’s

Easiest explanation - header PROVIDES the count() function to count the number of 1’s or HIGH bits in the bitset variable.



Discussion

No Comment Found

Related InterviewSolutions