SHARE
TWEET

Untitled

a guest Nov 16th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. void hitungluaslingkaran(){
  6.   float l, r;
  7.   const float phi = 3.14;
  8.   cout << "Masukkan panjang jari-jari lingkaran: ";
  9.   cin >> r;
  10.   l = phi*r*r;
  11.   cout << "Luas Lingkaran adalah = %5.2f\n" << l;  
  12. }
  13.  
  14. void HitungLuasSegitiga(){
  15.  
  16. }
  17.  
  18.  
  19. int main()
  20. {
  21.    int pilihan;
  22.     cout << "Masukan pilihan:\n1.Luas lingkaran\n2.Luas segitiga\n";
  23.     cin >> pilihan;
  24.     switch(pilihan){
  25.         case 1: hitungluaslingkaran();
  26.             break;
  27.         case 2: HitungLuasSegitiga();
  28.             break;
  29.     }
  30.  
  31.     return 0;
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top