Quick actions

cmd+k|ctrl+k

Navigation

Languages

3. Konversi Desimal ke Biner, Hexa, dan Oktal

Snippet info

Language

Cpp

Visibility

public

Author

dhafinshabir610

Created

2025-01-13T12:28:17.843466Z

Updated

2025-01-13T12:32:19.673859Z

#include <iostream>
#include <bitset>

//NAMA : Dhafin Shabir Alfatih
//NIM  : 3420230036

using namespace std;

int main() {
    int input;

    cout << "Program Konversi Bilangan\n\n";
    cout << "Masukkan bilangan desimal: ";
    cin >> input;
    cout << endl;

    cout << input << " dalam Biner adalah " << bitset<10>(input) << endl;
    cout << input << " dalam Hexadesimal adalah " << hex << uppercase << input << endl;
    cout << input << " dalam Oktal adalah " << oct << input << endl;

    return 0;
}
INFO