Welcome to MindCipher, a social repository of the world's greatest brain teasers, logic puzzles and mental challenges.

Abdulla Kaleem Abdul Ghafoor

Likes 0

Abdulla Kaleem Abdul Ghafoor must be new here...

Ratings 0

No ratings yet!

 Survivor //VARIABLE l1 is an array of numbers from 1-1500 \$last = end(\$l1); while(count(\$l1)>1){ foreach(\$l1 as \$a=> \$b) { if(\$a%2 != 0) ``````unset(\$l1[\$a]); `````` } ``````if(\$last == end(\$l1)) unset(\$l1); \$l1 = array_values(\$l1); foreach(\$l1 as \$a=> \$b) echo \$b."\n"; `````` echo " "; \$last = end(\$l1); } context Multiples of 8 plus 1 ``````for(\$i=1;\$i<50;\$i++){ if(\$i%2 != 0){ if(((\$i*\$i)-1) % 8 ==0){ echo ((\$i*\$i)-1)/8; echo "* 8 are :"; echo (\$i*\$i)-1;echo "
"; } } `````` } context Survivor //VARIABLE l1 is an array of numbers from 1-1500 ``````\$last = end(\$l1); while(count(\$l1)>1){ foreach(\$l1 as \$a=> \$b) { if(\$a%2 != 0) unset(\$l1[\$a]); } if(\$last == end(\$l1)) unset(\$l1); \$l1 = array_values(\$l1); foreach(\$l1 as \$a=> \$b) echo \$b."\n"; echo "