Fahrenheit/Celsius


SUBMITTED BY: Guest

DATE: March 19, 2014, 10:56 p.m.

FORMAT: PHP

SIZE: 705 Bytes

HITS: 5806

  1. <?php
  2. include "fctAux.inc.php";
  3. // appel des fonctions pour creer une page html
  4. enTete(); // fonction declaree dans fctAux
  5. contenu(); // fonction a definir ci-dessous
  6. pied(); // fonction declaree dans fctAux
  7. function contenu() {
  8. echo "\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<th>Celsius</th>\n\t\t\t\t<th>Fahrenheit</th>\n\t\t\t</tr>";
  9. for($celsius = -50; $celsius<=50;$celsius=$celsius+5) {
  10. echo "\n\t\t\t<tr>\n\t\t\t\t<td>".$celsius."</td>";
  11. $fahrenheit = $celsius*9/5+32;
  12. echo "\n\t\t\t\t<td>".$fahrenheit."</td>\n\t\t\t</tr>\n\t\t";
  13. }
  14. echo "</table>";
  15. }
  16. ?>

comments powered by Disqus