Konversi Suhu Menggunakan Bahasa C++


Kali ini saya akan memberikan tutorial konversi suhu dengan C++. Pada program ini user tinggal memasukkan suhu dalam celcius dan nantinya akan dikonversi ke dalam fahrenheit, reamur, dan kelvin.

Berikut tutoialnya ........


#include <conio.h>
#include <iostream.h>
main()
{
clrscr();
   float suhu1, fahn, cel, ream, kel;
cout<<"==============================="<<endl;
   cout<<" KONVERSI SUHU DARI CELCIUS KE"<<endl;
   cout<<" Fahnrenheit : Reamur : Kelvin"<<endl;
   cout<<"==============================="<<endl;
   cout<<"Masukkan suhu dalam Celsius : "; cin>>suhu1;
   cout<<"==============================="<<endl;
   fahn = suhu1 * 9/5 + 32;
   ream = suhu1 * 4/5;
   kel = suhu1+273;
   cout<<"        HASIL KONVERSI  "<<endl;
   cout<<"==============================="<<endl;
   cout<<"Fahnrenheit : "<<fahn<<" oC"<<endl;
   cout<<"Reamur      : "<<ream<<" oC"<<endl;
   cout<<"Kelvin      : "<<kel<<" oC"<<endl;
   cout<<"==============================="<<endl;
   getch();
}

SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 komentar:

Posting Komentar