Berikut ini saya akan membuat program sederhana konversi suhu :
#include <iostream>
#include <cstdlib>
/* 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[]) {
cout<<"_____________________________________________"<<endl;
cout<<"No.\t Suhu C\t\t Suhu R\t\t Suhu F"<<endl;
cout<<"_____________________________________________"<<endl;
for(int i=1;i<=10;i++)
{int c=i*10;
int r=((4*c)/5);
int f=(((9*c)/5)+32);
cout<<i<<"\t "<<c<<"\t\t "<<r<<"\t\t "<<f<<endl;
}
return 0;
}
Gambar program nya :
Gambar Output nya:
Semoga bermanfaat...
Wassalamualikum w.w.
0 komentar:
Posting Komentar