Coding:
#include <iostream>
using namespace std;
int main()
{
int cel, fah, rea;
cout << "=============================" << endl;
cout << "KONVERSI SUHU" << endl;
cout << "Celcius: Reamur: Fahrenheit" << endl;
cout << "=============================" << endl;
cout<< "Masukkan suhu dalam Celcius : ";
cin>>cel;
cout<< "Masukkan suhu dalam Reamur : ";
cin>>rea;
cout<< "Masukkan suhu dalam Fahrenheit : ";
cin>>fah;
cout << "=============================" << endl;
cout << "HASIL KONVERSI SUHU CELCIUS" << endl;
cout << "=============================" << endl;
cout << " fahrenheit : " << (((9.0/5.0)*cel) + 32)<<endl;
cout << " reamur : " << ((4.0/5.0)*cel)<<endl;
cout << "==============================" << endl;
cout << "HASIL KONVERSI SUHU REAMUR" << endl;
cout << "==============================" << endl;
cout << " celcius : " << ((5.0/4.0)*rea)<<endl;
cout << " fahrenheit: " << (((9.0/4.0)*rea) + 32)<<endl;
cout << "==============================" << endl;
cout << "HASIL KONVERSI SUHU FAHRENHEIT" << endl;
cout << "==============================" << endl;
cout << " celcius : " << ((fah - 32)*(5.0/9.0))<<endl;
cout << " reamur : " << ((fah - 32)*(4.0/9.0))<<endl;
}
Contoh di layar:

Tidak ada komentar:
Posting Komentar