Q&A Discussões
#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 Votos
5 RespostasQuente hoje
Using Python on VScode
2 Votes
Python Developer
0 Votes
Average of Two Numbers
0 Votes
Wayss
0 Votes
fully dynamic arrays
1 Votes
Hearts
0 Votes