-
What is the output of this program?
#include <iostream>
#include <string>
#include <bitset>
using namespace std;
int main ()
{
string Str;
bitset<5> BitsetData;
BitsetData.set();
Str = BitsetData.to_string<char, char_traits<char>,
allocator<char> >();
cout << Str ;
return 0;
}
-
- 1
- 11
- 111
- 1111
- 11111
Correct Option: E
In this program, We converted the bitset values to string and printing it.