Wednesday, December 1, 2010
C++
Program Menghitung Volume (Kubus, Bola & Tabung)
#include <iostream.h>
#include <conio.h>
void kubus(){
int s;
cout << "Rumus Kubus (s*s*s)";
cout << endl;
cout << "Masukan Sisi \t\t:";
cin >> s;
cout << "Hasil Kubus = " << s*s*s << endl;
cout << endl;
cout << endl;
}
void bola(){
int r,t;
cout << "Rumus Bola (3.14*r*r*t)";
cout << endl;
cout << "Masukan Jari-Jari \t:";
cin >> r;
cout << "Masukan Tinggi \t\t:";
cin >> t;
cout << "Hasil Bola = " << 3.14*r*r*t << endl;
cout << endl;
cout << endl;
}
void tabung(){
int p,l,t;
cout << "Rumus Tabung (p*l*t)";
cout << endl;
cout << "Masukan Panjang \t:";
cin >> p;
cout << "Masukan Luas \t\t:";
cin >> l;
cout << "Masukan Tinggi \t\t:";
cin >> t;
cout << "Hasil Tabung = " << p*l*t << endl;
cout << endl;
cout << endl;
}
void sukses(){
cout << "\t\t\tcihuii kamu berhasil";
cout << endl;
cout << "\t\t\t ..Sukses..";
cout << endl;
}
int main ()
{
cout << "Nama\t\t: Slamet Islan Al Hidayah";
cout << endl;
cout << "Nim\t\t: 10018075";
cout << endl;
cout << endl;
kubus();
bola();
tabung();
sukses();
getch ();
return 0;
}
0 Response to " Program Menghitung Volume (Kubus, Bola & Tabung) "
Post a Comment