#include <iostream>
using namespace std;
int main(int argc, char** argv) {
int cel,fah,rea,kel;
start:
cout<<"================================"<<endl;
cout<<"|konversi suhu dari celcius ke |"<<endl;
cout<<"|fahrenheit:reamur:kelvin |"<<endl;
cout<<"================================"<<"\n"<<endl;
cout<<"masukan suhu dalam celcius : "; cin>>cel;
cout<<"\n";
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"hasil konversi suhu "<<endl;
cout<<"farenheit : "<<(((9.0/5.0)*cel)+32)<<endl;
cout<<"reamur : "<<((4.0/5)*cel)<<endl;
cout<<"kelvin : "<<(cel+273)<<"\n"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
return 0;
}KONVEERSI SUHU
Rabu, 14 Oktober 2015
Minggu, 11 Oktober 2015
cara membuat program konversi suhu
Berikut merupakan Pemrograman Bahasa C++ bagaimana tentang menghitung konversi suhu dari Celcius ke fahrenheit,reamur, dan kelvin..
langsung saja di coba...
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<math.h>
void main()
{
int cel, fah, rea, kel;
start:
cout << "=============================" << endl;
cout << "KONVERSI SUHU DARI CELCIUS KE" << endl;
cout << " Fahrenheit: Reamur: Kelvin" << endl;
cout << "=============================" << endl;
cout<< "Masukkan suhu dalam Celcius : ";
cin>>cel;
cout << "=============================" << endl;
cout << "HASIL KONVERSI SUHU" << endl;
cout << "=============================" << endl;
cout << " fahrenheit : " << (((9.0/5.0)*cel) + 32)<<endl;
cout << " reamur : " << ((4.0/5.0)*cel)<<endl;
cout << " kelvin : " << (cel + 273)<<endl;
getch();
clrscr();
goto start;
}
langsung saja di coba...
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<math.h>
void main()
{
int cel, fah, rea, kel;
start:
cout << "=============================" << endl;
cout << "KONVERSI SUHU DARI CELCIUS KE" << endl;
cout << " Fahrenheit: Reamur: Kelvin" << endl;
cout << "=============================" << endl;
cout<< "Masukkan suhu dalam Celcius : ";
cin>>cel;
cout << "=============================" << endl;
cout << "HASIL KONVERSI SUHU" << endl;
cout << "=============================" << endl;
cout << " fahrenheit : " << (((9.0/5.0)*cel) + 32)<<endl;
cout << " reamur : " << ((4.0/5.0)*cel)<<endl;
cout << " kelvin : " << (cel + 273)<<endl;
getch();
clrscr();
goto start;
}
Langganan:
Postingan (Atom)