Menghitung Nilai Suhu
#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 c, f, r;
cout<<"Masukkan suhu c : ";
cin>>c;
r=4/(float)5*c;
f=9/(float)5*c;
f+=32;
cout<<"Nilai suhu c = "<<c<<" r = "<<r<<" f = "<<f;
return 0;
}
Output
/* 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 c, f, r;
cout<<"Masukkan suhu c : ";
cin>>c;
r=4/(float)5*c;
f=9/(float)5*c;
f+=32;
cout<<"Nilai suhu c = "<<c<<" r = "<<r<<" f = "<<f;
return 0;
}
Output
0 komentar:
Posting Komentar