Question #38200

php mysql..

using while loop.. celcius to fahrenheit & fahrenheit to celcius

display list of the celcius equivalents of zero degrees fahrenheit through 100 degrees fahrenheit. use the round() function to display celsius to one place after the decimal point.
1

Expert's answer

2014-01-09T15:41:02-0500

Answer on Question #38200


<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<title>while loop</title>
</head>
<body>
<p>Fahrenheit to celcius</p>
[tbl-0.html](tbl-0.html)
<p>Celcius to fahrenheit</p>
<table border="1px" cellspacing="0px">
<tr><td>C</td><td>F</td></tr>
<?php
$c = 0;
while ($c != 101) {
    echo "<tr><td>$c</td>";
    $f = $c * 9 / 5 + 32;
    echo "<td>" . round($f, 1) . "</td></tr>";
    $c = $c + 1;
}
?>
</table>
</body>
</html>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS