Mengkonversikan suhu dari celcius ke ruamur, fahrehait, dan kelvin
2. Identifikasi
Input : K,R,F,celcius;
Output : Reamur, Fahrehait, Kelvin
3. Algoritmanya
Deklarasi
int :K,R,F,celcius;
Deskripsi
R = 4/5*celcius;
F = 9/5*celcius+32;
K = celcius+273;
F = 9/5*celcius+32;
K = celcius+273;
C++ nya :
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int K,R,F,celcius;
raptor_prompt_variable_zzyz ="Masukkan suhu dalam celcius = ";
cout << raptor_prompt_variable_zzyz ;cin >> celcius;
R = 4/5*celcius;
F = 9/5*celcius+32;
K = celcius+273;
cout << "Reamur = " << R << endl;
cout << "Fahreit = "<< F << endl;
cout << "Kelvin = " << K << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int K,R,F,celcius;
raptor_prompt_variable_zzyz ="Masukkan suhu dalam celcius = ";
cout << raptor_prompt_variable_zzyz ;cin >> celcius;
R = 4/5*celcius;
F = 9/5*celcius+32;
K = celcius+273;
cout << "Reamur = " << R << endl;
cout << "Fahreit = "<< F << endl;
cout << "Kelvin = " << K << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#Screenshot c++
#Screenshot flowchart :
Tidak ada komentar:
Posting Komentar