Quick actions

cmd+k|ctrl+k

Navigation

Languages

10. Menghitung Luas dan Volume Kerucut

Snippet info

Language

Cpp

Visibility

public

Author

dhafinshabir610

Created

2025-01-13T13:08:10.518187Z

Updated

2025-01-13T13:11:10.494745Z

#include <iostream>
#define PI 3.14

// NAMA : Dhafin shabir Alfatih
// NIM  : 3420230036

using namespace std;

int main() {
    float r_alas, t, volume_kerucut, luas_alas, luas_selimut;

    cout << "Masukkan jari-jari alas: ";
    cin >> r_alas;
    cout << endl;
    cout << "Masukkan tinggi kerucut: ";
    cin >> t;
    cout << endl;

    luas_alas = PI * r_alas * r_alas;
    volume_kerucut = (1.0 / 3) * luas_alas * t;

    cout << "Luas alas: " << luas_alas << endl;
    cout << "Volume kerucut: " << volume_kerucut << endl;

    return 0;
}
INFO