satriafu5710

Luas & Volume Bola c++

Dec 8th, 2020 (edited)
837
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6.     float phi = 3.14;
  7.     float jari, luas, volume;
  8.  
  9.     cout << "\t Hitung Luas dan Volume Bola \n\n";
  10.  
  11.     cout << " Masukkan Jari-jari : ";
  12.     cin >> jari;
  13.    
  14.     luas = 4 * phi * jari * jari;
  15.     cout << "\n Luas dari Bola   : " << luas;
  16.  
  17.     volume = 4/(float)3 * phi * jari * jari * jari;
  18.     cout << "\n Volume dari Bola : " << volume;
  19. }
Add Comment
Please, Sign In to add comment