use a for loop, while, do while using PHP.

    • for loop:<html><body><?php
      $n=0;
      for($i=1; $i<=5; $i++)
      {
      $n=$n+$i;
      }
      echo “$n”;
      ?>
      </body>
      </html>
  • the while loop:<html>
    <body>
    <?php
    $x = 0;
    while($x != 11)
    {
    echo $x;
    $x++;
    }
    ?>
    </body>
    </html>
  • do while loop:
    <html>
    <body>
    <?php
    $x = 0;
    do
    {
    echo $x;
    $x++;
    }
    while($x != 11)
    ?>
    </html>
    </body> 

php to try this, then you must make sure your computer has support for PHP.

try it🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: