PHP ile 1-10 arası sayıları ve bu sayıların karesini ve küpünü bir tablo oluşturarak ekranda gösteren örnek.

muho61

Paylaşım Ekibi
Üyelik Tarihi
23 Aralık 2020
Mesajlar
262
Beğeniler
2
Ticaret: 0 / 0 / 0
Kod:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>olwa</title>
</head>

<body>
<?php
echo "<table border='1' width='200px'>";
echo "<tr>";
echo "<th>Sayı</th>";
echo "<th>Karesi</th>";
echo "<th>Küpü</th>";
echo "</tr>";
for ($i=1;$i<=10;$i++){
   echo "<tr>";
   echo "<td>$i</td>";
   echo "<td>",$i*$i,"</td>";
   echo "<td>",$i*$i*$i,"</td>";
   echo "</tr>";
}
echo "</table>";
?>
</body>
</html>
 
Üst