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 Answerswhy is return necessary
4 Votes
3 AnswersHot today
Error in python
5 Votes
Where have they gone
2 Votes
How to get messages?
2 Votes
what is wrong with my code?
0 Votes
Certificate
0 Votes
PYTHON
1 Votes
how to be good at coding
1 Votes