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
Need suggestions
0 Votes
Best code for creating games?
0 Votes
Java full stack
0 Votes
progaming
1 Votes
Calculator
0 Votes
Anyone Learning Godot?
1 Votes
Duration of heart refilling
0 Votes