What is the PHP code to display the first 1000 Armstrong number?

Asked by Last Modified  

1 Answer

Learn PHP

Follow 1
Answer

Please enter your answer

Software or Programming languages freelancer Trainer (BCA,Bcs, MCA)with 10+ experience

<html> <body> <!--totest thisscript type371or407,these are armstrong numbers--> <h2>Find Armstrong Number-PHP Script by<ahref="http://www.tutorialsmade.com/php-script-find-armstrong-number/">Tutorialsmade.com</a></h2> <form action=""method="post"> <input...
read more
<html> <body> <!--totest thisscript type371or407,these are armstrong numbers--> <h2>Find Armstrong Number-PHP Script by<ahref="http://www.tutorialsmade.com/php-script-find-armstrong-number/">Tutorialsmade.com</a></h2> <form action=""method="post"> <input type="text"name="number"/> <input type="submit"/> </form> </body> </html> <?php if($_POST) { //get the enter number $number=$_POST['number']; //store it in a temp variable $temp=$number; $sum=0; //loop till the quotient is 0 while($temp!=0) { $rem=$temp%10;//find reminder $sum=$sum+($rem*$rem*$rem);//cube the reminder and add it to the sum variable till the loop ends $temp=$temp/10;//find quotient. if 0 then loop again } //if the entered number and the $sum value matches then it is an armstrong number if($number==$sum) { echo"Armstrong Number"; }else { echo"Not an Armstrong Number"; } } ?> read less
Comments

Related Questions

Looking for Yii Framework experts who are willing to train.
A constructor is a special method of a class in object-oriented programming that initializes an object of that type. A constructor will have same name as the class, and can be used to set the values...
Pritam
How can I learn PHP?
first understand what is web server. then what is server side programming language. then start understanding how submitting form can reach to a php program. how get and post work. then
Diwaker
What is the fee for php classess?
Basic + Advanced + WD + MVC, full php developer profile Rs. 12000/- 4 month with practice.
Manjunath
Please Tell Me About PHP ?
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It allows...
Indal

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Read Your Gmail Emails Using PHP and IMAP
Hello Friends ,Recently I have worked on drip email campaign project for that I need to read emails using PHP From the gmail inbox. Here is the simple example for Read emails from the gmail: To start...

Necessity of Theory and Practical in Computer Science.
Upon studying a subject both theory and practical are important. Usually many schools concentrate more on theory and the marks not on the practical. Other and opposite kind of people prefer practical...

PHP
It is the base for many of the ecommerce websites. Many of the CMS develpoped in PHP platform.If programming cant done inititally try to think for logics and develop writing algorithms. Any doubts divyaravindiran@gmail.com.

Components of Digital Marketing
Content marketing Search Engine Optimization (SEO) Paid Search (PPC) Email marketing Social Media Marketing Digital Display Marketing (Ad Ops) Web Analytics and Reporting Mobile Marketing 30...
G

Geek M

0 0
0

Basics about the PHP
Basics: Father of PHP Rasmus Lerdorf. Developed in 1994. Existing in 1999 PHP stands for: PHP: Hypertext Preprocessor. PHP is an Open Source Software (OSS) free to download and Use. PHP is...

Recommended Articles

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for PHP Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you