Untitled

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { int pilihan; double suhu, hasil; cout << "Pilih jenis konversi suhu:" << endl; cout << "1. Celcius ke Fahrenheit" << endl; cout << "2. Celcius ke Kelvin" << endl; cout << "3. Fahrenheit ke Celcius" << endl; cout << "4. Fahrenheit ke Kelvin" << endl; cout << "5. Kelvin ke Celcius" << endl; cout << "6. Kelvin ke Fahrenheit" << endl; cout << "Masukkan pilihan (1-6): "; cin >> pilihan; switch (pilihan) { case 1: cout << "Masukkan suhu dalam Celcius: "; cin >> suhu; hasil = (suhu * 9.0 / 5.0) + 32; cout << "Hasil: " << hasil << " Fahrenheit" << endl; break; case 2: cout << "Masukkan suhu dalam Celcius: "; cin >> suhu; hasil = suhu + 273.15; cout << "Hasil: " << hasil << " Kelvin" << endl; break; case 3: cout << "Masukkan suhu dalam Fahrenheit: "; cin >> suhu; hasil = (suhu - 32) * 5.0 / 9.0; cout << "Hasil: " << hasil << " Celcius" << endl; break; case 4: cout << "Masukkan suhu dalam Fahrenheit: "; cin >> suhu; hasil = (suhu - 32) * 5.0 / 9.0 + 273.15; cout << "Hasil: " << hasil << " Kelvin" << endl; break; case 5: cout << "Masukkan suhu dalam Kelvin: "; cin >> suhu; hasil = suhu - 273.15; cout << "Hasil: " << hasil << " Celcius" << endl; break; case 6: cout << "Masukkan suhu dalam Kelvin: "; cin >> suhu; hasil = (suhu - 273.15) * 9.0 / 5.0 + 32; cout << "Hasil: " << hasil << " Fahrenheit" << endl; break; default: cout << "Pilihan tidak valid!" << endl; } return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines