Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float luasPermukaan(float r, float s)
- {
- float phi = 3.14;
- float hasil;
- hasil = phi * r * (r + s);
- return hasil;
- }
- float volumeKerucut(float r, float t)
- {
- float phi = 3.14;
- float hasil;
- hasil = 1 / (float)3 * phi * r * r * t;
- return hasil;
- }
- int main()
- {
- float phi = 3.14;
- float r, tinggi, s; // s = Panjang Garis Pelukis
- float luasP, volume;
- cout << "\t Luas Permukaan & Volume Kerucut \n\n";
- cout << " Masukkan Jari-jari : ";
- cin >> r;
- cout << " Masukkan Tinggi : ";
- cin >> tinggi;
- cout << " Masukkan S : ";
- cin >> s;
- luasP = luasPermukaan(r, s);
- cout << "\n Luas Permukaannya : " << luasP;
- volume = volumeKerucut(r, tinggi);
- cout << "\n Volume Kerucutnya : " << volume;
- }
Add Comment
Please, Sign In to add comment