adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <string>
    #include <bitset>
    using namespace std;
    int main ()
    {
        string mystring;
        bitset<4> mybits; 
        mybits.set();
        mystring = mybits.to_string<char, char_traits<char>, 
        allocator<char> >();
        cout << mystring << endl;
        return 0;
    }

a.

0000

b.

0001

c.

0011

d.

1111

Answer: (d).1111

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?