Skip to content

Instantly share code, notes, and snippets.

@EduardoLopes
Created July 11, 2012 00:52
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 EduardoLopes/3087209 to your computer and use it in GitHub Desktop.
Save EduardoLopes/3087209 to your computer and use it in GitHub Desktop.
Calcular o volume de um cilindro.
<?php
function volumeCilindro($raio, $altura)
{
$volume = M_PI * pow($raio, 2) * $altura;
return round($volume, 2);
}
echo volumeCilindro(2, 10); //125.66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment