Program C++ Konversi Suhu Celcius ke Fahrenheit, Reamur dan Kelvin


Script 

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <windows.h>
void main ()
{
system (“color f0″);    //untuk membuat warna background putih dan warna tulisan hitam
float c,f,r,k;
printf (“===============================”);
printf (“\nKONVERSI SUHU DARI CELCIUS KE”);
printf (“\nFahrenheit | Reamur | Kelvin\n”);
printf (“===============================”);
printf (“\nMasukkan Suhu Dalam Celcius : “);
scanf (“%f”,&c);
f = (1.8*c)+32;  //Penghitungan koversi ke fahrenheit
r= 0.8*c;            //Penghitungan koversi ke reamur
k=c+273.15;      //Penghitungan koversi ke kelvin
printf (“===============================”);
printf (“\n       HASIL KONVERSI”);
printf (“\n===============================”);
printf (“\nFahrenheit : %3.2f oC”, f);        //Menampilkan hasil konversi ke fahrenheit
printf (“\nReamur     : %3.2f oC”, r);        //Menampilkan hasil konversi ke reamur
printf (“\nKelvin     : %3.2f oC”, k);         //Menampilkan hasil konversi ke kelvin
getche ();
}

Hasil

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s