hitung konversi temperatur dari celcius ke fahrenheit, reamur, dan kelvi

#include <cstdlib>

#include <iostream>

#include<math.h>

using namespace std;

int main()

{

char ulang;

double fahrenheit,celcius,reamur,kelvin ;

cout<<“====== Program perhitungan Konversi suhu ke Fahrenheit, Reamur dan Kelvin ====== “<<endl;

cout<<“===================================================================”<<endl;

do

{

cout<< “Silahkan masukkan suhu Celcius : “;

cin>>celcius;

fahrenheit = celcius * 1.8+32;

reamur = celcius * 0.8;

kelvin = celcius + 273;

cout<< “Konversi suhu dalam Fahrenheit adalah : ” << fahrenheit;

cout<<endl ;

cout<< “Konversi suhu dalam Reamur adalah : ” << reamur ;

cout <<endl ;

cout<< “Konversi suhu dalam Kelvin adalah : “;

cout<<kelvin ;

cout<<endl;

cout<<“===========================================================”<<endl;

cout<<“Ulangi penghitungan Konversi suhu ke Fahrenheit, Reamur dan Kelvin <y/t> ? “;

cin>>ulang;

} while(ulang==’y’);

return 0;

}

konversi_suhu

Posted in Algoritma Pemrograman & Elemen Dasar C++ | Tagged , | Leave a comment

pengitungan inisialisasi

#include <cstdlib>

#include <iostream>

#include<math.h>

using namespace std;

int main()

{

char ulang,chr1,chr2,hasil1,hasil2,hasil5;

int ix,iy,hasil4 ;

float fx,fy,hasil3 ;

cout<<“====== Program perhitungan Inisialisasi ====== “<<endl;

cout<<“====================================”<<endl;

do

{

ix = 5;iy=10;

fx=0.001; fy=-17.08;

chr1= ‘A’; chr2=’E’;

hasil1 = chr2 * ix;

hasil2 += chr2;

hasil3 += (fy *= (iy/ix));

hasil4 = (int) (iy / ((int) fy));

hasil5 == chr1 + ix;

cout<< “ix = ” << ix ;

cout<< “; “;

cout<< “iy = “<<iy;

cout<< “; “;

cout<< “fx = “<<fx;

cout<< “; “;

cout<< “fy = “<<fy;

cout<< “; “;

cout<< “chr1 = “<<chr1;

cout<< “; “;

cout<< “chr2 = “<<chr2;

cout<<endl<< endl;

cout<< “Hasil dari Inisialisasi (chr1 = chr2 * ix) = ” ;

cout<< hasil1 << endl;

cout<< “Hasil dari Inisialisasi (chr1 += chr2 ) = ” ;

cout<< hasil2 << endl;

cout<< “Hasil dari Inisialisasi (fx += (fy *= (iy/ix))) = ” ;

cout<< hasil3 << endl;

cout<< “Hasil dari Inisialisasi (iy = (int) (iy / ((int) fy))) = ” ;

cout<< hasil4 << endl;

cout<< “Hasil dari Inisialisasi (chr2 == chr1 + ix) = ” ;

cout<< hasil5 << endl<< endl;

cout<<“=======================================================”<<endl;

cout<<“Ulangi Program Inisialisi <y/t> ? “;

cin>>ulang; cout<<endl;

} while(ulang==’y’);

return 0;

}

inisialisasi

Posted in Algoritma Pemrograman & Elemen Dasar C++ | Tagged , | Leave a comment