3
21/10/2024 7:01 pm
Topic starter
Create a function which returns rectangle area with given width and height:
- 3 * 4 = 12
- 6 * 8 = 8
- 7 * 8 = 56
A = L * W where A is the area, L is the length, W is the width, and * means multiply.
1 Answer
2
21/10/2024 7:03 pm
Here is my function:
<?php $width = readline(); $height = readline(); $area = calculateArea($width, $height); echo $area; function calculateArea($paramWidth, $paramHeight) { return $paramWidth * $paramHeight; }