Alessandra avatar

Armstrong

drago18121996

Published: 24 Apr 2025 › Updated: 24 Apr 2025

Armstrong

declare(strict_types=1);

function isArmstrongNumber(int $number): bool
{
$res = 0;
$str_cr = (string)$number;
$len = strlen((string)$number);
for($i=0; $i<$len; $i++)
{
$res += ((int)$str_cr[$i]) ** $len;
var_dump($res);
}
return $number == $res;

}

Leave Armstrong to:

Written by

Writer / Researcher

Read more #ita posts


Best Posts From Alessandra

We have not curated any of drago18121996's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Alessandra