How to print a number in 24 bits binary representation using C++

1 Answer

0 votes
#include <iostream>
#include <bitset>

using std::cout;
using std::endl;

int main()
{
	cout << "21,982,823 : " << std::bitset<24>(21982823) << endl;
}

/*
run:

21,982,823 : 010011110110111001100111

*/

 



answered Feb 23, 2018 by avibootz
edited Feb 23, 2018 by avibootz
...