answersLogoWhite

0

<?php

for($i=1; $i<=1000; $i++)

{

$num=$i;

$sum=0;

while($num>=1)

{

$rem=$num%10;

$qub=$rem*$rem*$rem;

$sum=$sum+$qub;

$num=$num/10;

}

if($sum==$i)

{

echo("<br>$sum");

}

}

?>

visit: http://tutorial.planetetutors.com

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What are semantics in PHP?

PHP is related with HTML. HTML can be included into PHP script as well as PHP script can be included into HTML code. PHP begins and ends with &lt;?php ?&gt;. PHP is mix of few languages so semantics is mixed too.


What is syntax in php?

We can use php tags in different ways. &lt;?php //php code to be written here ?&gt; OR &lt;? //php code ?&gt; This tag will not work when we using editors such as macromedia dreamweaver. OR &lt; script language="php"&gt; //php code &lt;/script&gt;


How do you change the language code in a PHP page?

I have little idea of your question however &lt;?php #code in here ?&gt; is the starter for PHP, and then anything outside is HTML.


How do you compile php code?

To compile PHP code, you do not use a traditional compiler like you would with languages such as C++ or Java. PHP is an interpreted language, meaning the code is executed directly by the PHP interpreter. To run PHP code, you need a web server with PHP installed, such as Apache or Nginx. The PHP interpreter reads the code, processes it, and generates the output dynamically.


How do you create an area of a webpage to display PHP results?

PHP code blocks start with &lt;?php and end with ?&gt;.


What was the name and number of Neil Armstrongs spacecraft?

Apollo and11


What file extension is used to save a php file after code has been written into it?

The file extension for PHP is .php


How do you embed PHP code in C code?

PHP and C are two different programming languages that cannot directly interact with eachother. You can have a program made with C call a PHP script, using its output (an indirect interaction), but there's no way to "embed" PHP into C code.


Why you do not see any PHP code when you view the source code of a PHP page in the browser?

PHP is server-side, the browser itself does not interpret it. Rather, the browser sends a query to the server, and the PHP scripting generates custom HTML document. It is this HTML that you are seeing the source code of.


How do you write a program to print Inverse number in PHP?

There are two types of inverse numbers in this context: additive and multiplicative. An additive inverse number is a number that's had its sign flipped: positive becomes negative, and negative becomes positive. The PHP code for this would be: $result=-$number; A multiplicative inverse number is a number that's been divided into 1. So 5 becomes 1/5, and 1/5 becomes 1/1/5, or 5. The PHP code for this would be: $result=1/$number;


Is it able to send recurring eMail with PHP code such as sending an eMail every month automatically with PHP code?

By making use of Linux's cron jobs, you could schedule a PHP job to be run monthly using this line of code at the bottom of the file opened by running crontab -e:0 0 1 * * /usr/local/bin/php /path/to/php/file.phpIn that PHP file you could have your code to send an email like so:


What is meaning of PHP is an open source software?

It means that the source code of PHP (not PHP code, but the C/C++ code used to build the PHP binary) is published and available to anyone. It also means that anyone can contribute fixes and improvements to the source code.Read more here: open-source