Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

4 numbers that multiply to make 120

Name: Anonymous 2007-03-09 16:50 ID:yO9TuDQD

I suck pretty hard and can't figure out a way to do this, I am doing it in php, cause it's pretty much all I know..
so I tried
<?php
$v1=1;
$v2=1;
$v3=1;
$v4=1;
$v5=1;

while ($v4 < 10) {
    print "$v1 * $v2 * $v3 * $v4 = $v5<br>\n";
    $v1++;
    $v5 = $v1 * $v2 * $v3 * $v4;
    print "$v1 * $v2 * $v3 * $v4 = $v5<br>\n";
    $v2++;
    $v5 = $v1 * $v2 * $v3 * $v4;
    print "$v1 * $v2 * $v3 * $v4 = $v5<br>\n";
    $v3++;
    $v5 = $v1 * $v2 * $v3 * $v4;
    print "$v1 * $v2 * $v3 * $v4 = $v5<br>\n";
    $v4++;
    $v5 = $v1 * $v2 * $v3 * $v4;
    print "$v1 * $v2 * $v3 * $v4 = $v5<br>\n";
    }
 
print "FINISHED AND SHIT";
?>
which obviously doesn't work as it just does
1 * 1 * 1 * 1 = 1
2 * 1 * 1 * 1 = 2
2 * 2 * 1 * 1 = 4
2 * 2 * 2 * 1 = 8 etc.
missing out lots of numbers.

tl;dr how do i make php find out what 4 numbers multiply together to make 120.

Name: Anonymous 2007-03-10 12:27 ID:At8izKoi

Stop wrapping your single line shit in code blocks, idiots. Even multi line programs often look better in variable width fonts.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List