Jump to content

litebearer

Members
  • Posts

    2,356
  • Joined

  • Last visited

Everything posted by litebearer

  1. Not sure what you mean by How are the functions supposed to work if they are not supplied the necessary information? BTW - I had a small typo above - here is corrected and TESTED version (it DOES work) <?PHP function area($a,$b) { return $a*$b; } function perimeter($a,$b) { echo "Length: " . $a . "<br>"; echo "Width : " . $b . "<br>"; echo "Perimeter: " . (2 * ($a + $b)) . "<br>"; echo "Area : " . area($a,$b); return; } $length = 10; $width = 5; echo perimeter($length,$width); ?>
  2. do you mean... $length=20; $width=10; function area($a,$b) { return $a*$b; } function perimeter($a,$b) { echo "Length: " . $a . "<br>": echo "Width : " . $b . "<br>"; echo "Perimeter: " . (2 * ($a + $b)) . "<br>"; echo "Area : " . area($a,$b); return; } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.