Resource Code "Konversi Suhu"


Berikut ini adalah script sederhana untuk program konversi suhu dalam c++. Silahkan Dicoba :)


#include <iostream.h>
#include <conio.h>
void main ()
{
clrscr ();
float suhu[3];
cout <<"masukkan nilai celcius= ";
cin >> suhu [1];
suhu [2]=suhu [1]+1.8+32;
suhu [3]=suhu [1]*0.8;
suhu [4]=suhu [1]*273.15;
cout <<"suhu "<<suhu [1]<<"dalam Fahrenheit "<<suhu [2]<<"F""\n";
cout <<"suhu "<<suhu [1]<<"dalam Reamur "<<suhu [3]<<"R""\n";
cout <<"suhu "<<suhu [1]<<"dalam Kelvin "<<suhu [4]<<"K""\n";
getch ();
}

Categories: Share

Leave a Reply