PHP calculates the code for all daffodils smaller than 1000. The number of daffodils is the number of n (3) digits, which is equal to the sum of the n power of each number. for example, 153 is a daffodils, 1531 + 5 + 3. write a program to solve all the daffodils less than 1000. the number of daffodils is the number of n (> = 3) digits, which is equal to the sum of the n power of each number. for example, 153 is a daffodils, 153 = 1 Gbit/s + 5 Gbit/s + 3 Gbit/s. write a program to solve all the daffodils less than 1000.
The code is as follows:
For ($ I = 100; $ I <1000; $ I ++ ){
$ A = intval ($ I/100 );
$ B = intval ($ I/10) % 10;
$ C = $ I % 10;
If (pow ($ a, 3) + pow ($ B, 3) + pow ($ c, 3) ==$ I ){
Echo $ I. "\ t ";
}
}
?>
The number of digits (= 3), which is equal to the sum of the n power of each digit. for example, 153 is a daffodils, 153 = 1 + 5 + 3. write a program to solve all the daffodils less than 1000....