Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Last active June 8, 2018 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajjadyousefnia/76840e1f99d455e825078b17e1e1f9b9 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/76840e1f99d455e825078b17e1e1f9b9 to your computer and use it in GitHub Desktop.
fun printCircumferenceAndArea(radius: Double): Unit {
fun calCircumference(radius:Double)= (2 * Math.PI) * radius
val circumference = "%.2f".format(calCircumference())
fun calArea(radius:Double)= (Math.PI) * Math.pow(radius, 2.0)
val area = "%.2f".format(calArea())
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment