www.webdeveloper.com
Results 1 to 3 of 3

Thread: give me an idea

  1. #1
    Join Date
    Sep 2013
    Posts
    18

    give me an idea

    8 6 8 7 9

    (8+6, 6+8, 8+7, 7+9)
    ( 14, 14, 15, 16)
    5 , 5 , 6, 7 like this


    8 6 8 7 9
    5, 5, 6, 7
    1, 2, 4
    3, 6
    9





    i want a php code for this logic.... any one please help meeee

  2. #2
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    I did this, the logic might not be 100% correct, but I get the right results:

    PHP Code:
    <?php

        $num 
    = array(86879);

        while (
    $num) {
            echo 
    implode(', '$num) . '<br />';
            for (
    $i 0$j = array(); $i count($num) - 1; ++$i) {
                
    $k $num[$i] + $num[$i 1];
                
    $j[] = ($k + (($k - ($k 10)) / 10)) % 10;
            }
            
    $num $j;
        }

    ?>
    Output

    8, 6, 8, 7, 9
    5, 5, 6, 7
    1, 2, 4
    3, 6
    9
    JavaScript: Learn | Validate | Compact | bionoid

  3. #3
    Join Date
    Sep 2013
    Posts
    18
    Hey it's wrkng..... thank dude....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles