HOW TO PRINT CHESS BOARD USING FOR LOOP IN PHP
<body>
<table border="3" cellspacing="3" height="650" width="1350" align="center">
<?php
for($x=1; $x<=10; $x++){
for($y=1; $y<=10; $y++){
if(($x+$y)%2==0){
echo '<td bgcolor="#00000"></td>';
}
else{
echo '<td bgcolor="#FFFFFF"></td>';
}
}
echo '</tr>';
}
?>
</table>
</body>
No comments:
Post a Comment