PHP Compiler
<!DOCTYPE html> <html> <body> <?php $num = 496; $i = 1; $total = 0; for($i=1; $i<$num; $i++) { if($num % $i == 0) $total += $i; } if($total == $num) echo "$num is a perfect number"; else echo "$num is not a perfect number"; ?> </body> </html>
OUTPUT
496 is a perfect number
×

Save as Private