C++ bitset test() FunctionLast Updated : 17 Mar 2025 C++ bitset test() function is used to test whether the bit at position p is set or not. If bit is set at position p then it returns true or false. SyntaxParameterp: It takes one parameter and it specifies the index at which the bit is set or not. Return valueIt returns true if the bit at position p is set, and false if it is not set. Example 1Output: bitset b is set at position 3 : 0 bitset b is set at position 2 : 1 Example 2Output: bitset b is set at position 3 : 0 bitset b1 is set at position 2 : 1 Example 3Output: bitset is set at postion 1 Next TopicC++ bitset |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India