Contoh Program C++ Celsius Ke Fahrenhit:
// Quis.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream.h"
#include "conio.h"
#include "stdlib.h" // coment clear scren
int main(int argc, char* argv[])
{
int z,d,menu;
float r,f;
double c;
do { // loping atau perulangan menu
cout << "pilihan :" <<endl;
cout << "1.celsius ke reamus" <<endl;
cout << "2.celsius ke fahrenheit"<<endl;
cout << "3.Exit";
cout << endl;
cout << "Menu pilihan anda : ";
cin >> menu;
cout << endl;
system("cls"); // comentnya
if (menu==1)
{
cout << "masukan celsius= ";
cin >> c;
while (c<=99)
{
r = c*0.8;
cout<<"hasil konversi suhu dari "<<c<<" derajat celcius ke reamur= "<<r<<endl;
c=c+10;
}
r=100*0.8;
cout<<"hasil konversi suhu dari "<<c<<" drajat celcius ke reamur= "<<r<<endl;
cout<<endl;
}
else
if (menu==2)
{
cout << "masukan celsius = ";
cin >> c;
while(c <= 99)
{
f=c*1.8+32;
cout<<"hasil konversi suhu dari "<<c<<" derajat celcius ke fahrenheit= "<<f<<endl;
c=c+10;
}
f=100*1.8+32;
cout<<"hasil konversi suhu dari "<<c<<" drajat celcius ke Fahrenheit= "<<f<<endl;
cout<<endl;
}
}while(menu != 3); // perulangan menu
return 0;
}
Contoh Program C++ Celcius ke Fahrenheit
Posted by sukariyanta on 4:12 PM
0 comments:
by Pakto
by misterdarvus
Post a Comment