Senin, 14 Maret 2016

KONVERSI SUHU

1.      Konversi suhu
Algoritma:
-          Masukan interger derajat Celcius
-          Menghitung ekivalensi dalam derajat R,F,K
-          Menampilkan hasilnya di layar
-           
#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
{
                                    int c;
                         float r,f,k;
                         cout<<"masukkan suhu c :";
                         cin>>c;
                                    r=4/5*c;
                                    r=4/(float)5*c;
                                    f=(1.8*c)+32;
                                    f=((9/(float)5)*c)+32;
                                    k=c+273;
                                    cout<<"nilai suhu adalah "<<"\t r= "<<r<<"\t f= \t k= "<<f;
                         }
                         return 0;

}

Tidak ada komentar:

Posting Komentar