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
Is this realistic enough?
2 Votes
Need friends
0 Votes
"Whatâs the best way to combine creativity and coding? Can storytelling improve web apps?"
1 Votes
Web Development
0 Votes
Please complete this code.
0 Votes
Cybersecurity techies
2 Votes