PHP Programing language

Create Table Fahrenheit and Celsius
Previous Home Next
<html>
<head>
<title>Fahrenheit and celsius table </title>
</head>
<body>
<?php
$Fahrenheit = -50;
$stop_Fahrenheit = 50;

print '<table>';
print '<tr><th>Fahrenheit</th><th>Celsius</th></tr>';
while ($Fahrenheit<= $stop_Fahrenheit) {
    $celsius = ($Fahrenheit - 32) * 5 / 9;
    print "<tr><td>$Fahrenheit</td><td>$celsius</td></tr>";
    $Fahrenheit+= 5;
}
print '</table>';
?>
</body>
</html> 


 

output
FahrenheitCelsius
-50 -45.555555555556
-45 -42.777777777778
-40 -40
-35 -37.222222222222
-30 -34.444444444444
-25 -31.666666666667
-20 -28.888888888889
-15 -26.111111111111
-10 -23.333333333333
-5 -20.555555555556
0 -17.777777777778
5 -15
10 -12.222222222222
15 -15
10 -9.4444444444444
15 -9.4444444444444
20 -6.6666666666667
25 -3.8888888888889
30 -1.1111111111111
35 1.6666666666667
40 4.4444444444444
45 7.2222222222222
50 10
Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: