willysec_id

Program penghitung luas dan keliling lingkaran

Feb 21st, 2021
429
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. phi = 3.14
  2.  
  3. def LuasLingkaran(r):
  4.     luas = phi * r * r
  5.     print("Luas lingkaran: %f" % luas);
  6.  
  7. def KelilingLingkaran(r):
  8.   keliling = phi * (r + r)
  9.   return keliling;
  10.  
  11.  
  12. r = input('Masukan jari-jari lingkaran: ')
  13. print("Keliling lingkaran: " + str(KelilingLingkaran(int(r))))
  14. luas = LuasLingkaran(int(r))
RAW Paste Data