Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 1, 2021 16:19
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 parzibyte/5f8068438c31af00b2f77ca30d931985 to your computer and use it in GitHub Desktop.
Save parzibyte/5f8068438c31af00b2f77ca30d931985 to your computer and use it in GitHub Desktop.
<?php
// https://parzibyte.me/blog
define("PI", 3.1416);
# Leer el diámetro desde el formulario que fue enviado a este script
$diametro = $_POST["diametro"];
/*
Realizar cálculos
*/
$circunferencia = PI * $diametro;
$radio = $diametro / 2;
/*
Imprimir
*/
echo "La circunferencia del círculo es: " . $circunferencia . " <br>";
echo "El radio del círculo es " . $radio . " <br>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment