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
Where is the error
0 Votes
Help
0 Votes
Full form of HTML
0 Votes
Please help me
0 Votes
Which one is better?? And why??
1 Votes
Use of global function in c
0 Votes
Game
0 Votes