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
Tag
AJAX
Canvas
CSS
Google Charts
HTML
Javascript
jQuery
JSON
SASS
SVG
Description
Save