C++ Konversi Suhu

#include <iostream>
#include <conio.h>
#include <math.h>
int main(){
//variable
int x;
cout << "Berapa angka pada termometer anda? ";
cin >> x;
cout<<endl;
cout << "Celsius      " << x << endl;
cout << "Fahrenheit   " << (x / 5) * 9 + 32 << endl;
cout << "Reamur       " << (x / 5) * 4 << endl;
cout << "Kelvib       " << x + 273 << endl;
cout << "" << endl;
cout << "Ubah dari Celsius, masukkan angka! ";
cin >> x;
cout<<endl;
cout << "Fahrenheit   " << (x / 5) * 9 + 32 << endl;
cout << "Reamur       " << (x / 5) * 4 << endl;
cout << "Kelvib       " << x + 273 << endl;
cout << "" << endl;
cout << "Ubah dari Fahrenheit, masukkan angka! ";
cin >> x;
cout<<endl;
cout << "Celsius      " << ((x - 32)/ 9) * 5 << endl;
cout << "Reamur       " << ((x - 32)/ 9) * 4 << endl;
cout << "Kelvib       " << ((x - 32)/ 9) * 5 + 273 << endl;
cout << "" << endl;
cout << "Ubah dari Reamur, masukkan angka! ";
cin >> x;
cout<<endl;
cout << "Celsius      " << (x / 4) * 5 << endl;
cout << "Fahrenheit   " << (x / 4) * 9 + 32 << endl;
cout << "Kelvib       " << (x / 4) * 5 + 273 << endl;
cout << "" << endl;
cout << "Ubah dari Kelvin, masukkan angka! ";
cin >> x;
cout<<endl;
cout << "Celsius      " << x - 273 << endl;
cout << "Fahrenheit   " << ((x - 273) / 5) * 9 + 32 << endl;
cout << "Reamur       " << ((x - 273) / 5) * 4 << endl;
cout << "" << endl;
   getch();
   return 0;
}

0 Response to "C++ Konversi Suhu"

Posting Komentar