Senin, 04 April 2016

mencari luas permukaan dan volume bola


#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) {
    cout<<"Luas Permukaan dan volume Bola\n";
    int r;
    float Luas,Volume;
    cout<<"Masukkan jari-jari : ";
    cin>>r;
    Luas=4*22/(float)7*r*r;
    Volume=4/3*22/(float)7*r*r*r;
    cout<<"Luas Permukaan Bola : "<<Luas<<"\n";
    cout<<"Volume : "<<Volume;
    return 0;
}

Tidak ada komentar:

Posting Komentar