Go Back   Flash Flash Revolution > General Discussion > Critical Thinking > Homework & Help
Register FAQ Community Calendar Today's Posts Search

Closed Thread
 
Thread Tools Display Modes
Old 07-20-2009, 09:36 AM   #1
Jintu
FFR Player
 
Join Date: Jul 2009
Posts: 15
Default Please advice how the following code works

Code:
<html>
<!-- test01.php -->
<body>

   <?php 
      $x = 2;
      for ($i = 1; $i <= 6; $i++)
      {
          if ($i % 2 == 1)
          {
             $x++;
          }
          print $i . 'x' . $i * $x . " ";
      }

   ?>

</body>
</html>
*******
Answer:

1x3 2x6 3x12 4x16 5x25 6x30

May I know, how did they arrive at the answer???

Thanks...
Jintu is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:56 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution