Discussions Q&R
#include <iostream>
#include <bitset>
int main()
{
int myDecimalNumber;
std::cin >> myDecimalNumber;
std::string binary = std::bitset<8>(myDecimalNumber).to_string(); //to binary
std::cout<<binary<<"\n";
unsigned long decimal = std::bitset<8>(binary).to_long();
std::cout<<decimal<<"\n";
return 0;
}
2 Votes
5 RéponsesAujourd'hui en vedette
Guys help please
1 Votes
Python question
2 Votes
Are websites hackable?
1 Votes
Python
1 Votes
TICTACTOE
0 Votes
C# and sql
1 Votes
Error
0 Votes
What course to take for AI?
0 Votes
Learn python
0 Votes