Advertisement
satriafu5710

Luas & Volume Kerucut c++

Dec 9th, 2020
2,038
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6.     float phi = 3.14;
  7.     float rusuk, tinggi, s;  // s = Panjang Garis Pelukis
  8.     float luasP, volume;
  9.  
  10.     cout << "\t Luas Permukaan dan Volume Kerucut \n\n";
  11.  
  12.     cout << " Masukkan Rusuk  : "; cin >> rusuk;
  13.     cout << " Masukkan Tinggi : "; cin >> tinggi;
  14.     cout << " Masukkan S      : "; cin >> s;
  15.  
  16.     luasP = phi * rusuk * (rusuk + s);
  17.     cout << "\n Luas Permukaannya : " << luasP;
  18.  
  19.     volume = 1/(float)3 * phi * rusuk * rusuk * tinggi;
  20.     cout << "\n Volumenya         : " << volume;
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement