Q&A Discussions
#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 AnswersHot today
How to allow one instance of exe
2 Votes
What has happened?
1 Votes
Theater management help me
2 Votes
Python
1 Votes
What should I add/improve ?
1 Votes
Tools for web design?
1 Votes