- Judul menghitung luas permukaan bola dan volume bola
- Input programnya
#include <iostream>
using namespace std;
/*run this program using the console pauser or add your own getch, system("pause") or input laptop */
int main (int argc, char** argv) {
float phi=3.14;
float r, vol, luas;
cout<<"Masukkan jari-jari: ";
cin>>r;
luas=((4*phi)*r*r);
vol=(1.3*phi*r*r*r);
cout<<"Luas permukaan bola : "<<luas<<endl;
cout<<"Volume Bola : "<<vol<<endl;
return 0;
}
Output yang dihasilkan adalah
No comments:
Post a Comment