UrbanPro

Learn PHP from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

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

Which is best to build web applications: PHP, Python, or Ruby? Why?
I have used almost all of the three language in my web working experience.PHP:It may be not that cool and I think it doesn't rely too much on the framework. Yes, PHP is just a language, but it is the only...
Sunil
0 0
7
what is a file handling
File handling is an important part of any web application. You often need to open and process a file for different tasks. PHP has several functions for creating, reading, uploading, and editing files....
Mayank
Which is better, PHP or Python? Why?
Python . Simple syntax,More readable,General purpose programming language
Kartheek
0 0
5
Between Java and Python, which one is better to learn first and why?
Both the development programs come with their strong suits. While Java allows you to enjoy the cross-platform support, Python helps you execute on at least ten different operating systems. It would help...
Priyanka
0 0
5
Where can I get Python online training?
You can get many institutes in google which are providing online training.
Taranum

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

Ask a Question

Related Lessons

How To Connect To Server Using PHP?
It is very easy to connect to server using PHP and MYSQL. PHP is a very friendly Programming Language that any one can learn who know the basics of the Front End Development. PHP is a programming Language...

A Brief About Php And MySQL
PHP is a recursive acronym which stands for Hypertext Preprocessor. PHP is essentially a coding or scripting language which can be utilized in diverse web development and software based applications. If...

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...

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

How to be a good developer?
I think practice more and read less.see what the logic in the programs then you must be a good developer
B

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
X

Looking for PHP Classes?

The best tutors for PHP Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn PHP with the Best Tutors

The best Tutors for PHP Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more