Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions exercises/binary_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@
Insert first number: 8
The binary number is: 1000
*/


#include <iostream>
#include <bitset>
using namespace std;

int main() {
int number;

cout << "Insert first number: ";
cin >> number;

cout << "The binary number is: " << bitset<32>(number) << endl;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potresti spostare questa implementazione in una funzione a parte al posto di scrivere tutto sul main


return 0;
}