New course! Every coder should learn Generative AI!
Try a free lessonQ&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
Can anyone guide me
0 Votes
Internal vs external JS
2 Votes
Python Core
0 Votes
[SOLVED] Ballpark Challenge
1 Votes