Javatpoint Logo
Javatpoint Logo

C++ bitset any() Function

C++ bitset any() function is used to test whether at least one bit from bitset is set or not. It returns a boolean value i.e either true or false.

Syntax

Parameter

It does not take any parameter.

Return value

It returns a Boolean value either 0 or 1.

Example 1

Output:

1100 has a minimum of one-bit set
000000 does not have any bits set

Example 2

Output:

2 has a minimum of one-bit set
0 does not have any bits set
Next TopicC++ bitset



Please Share

facebook twitter google plus pinterest