React Component Nesting and Reusability Explained – A Beginner's Guide 2026

Image
1. Introduction to React Component Nesting and Reusability React JS is a popular JavaScript library used to create interactive and user-friendly web applications. One of the most useful concepts in React development is component-based architecture. Instead of writing an entire website inside one large file, developers divide the user interface into smaller and manageable parts called components. Two important concepts in this approach are component nesting and component reusability. Component nesting means placing one React component inside another component to build a complete user interface. For example, a website page may contain a header, navigation bar, sidebar, content section, and footer. Each section can be developed as a separate component and combined inside a main component. Component reusability means creating a component once and using it multiple times in different parts of an application. For example, the same button, product card, or navigation menu can be reused withou...

armstrong number program in php

Armstrong number PHP Program

Armstrong number

Armstrong number

 1] one whose value is equal to the sum of the cubes of its digits.

  2]  There are Four 3digit Armstrong number - 153, 370, 370 , 407, 1634, 8208,  etc

Armstrong number program in php

Example :-

<?php
$num=150;
$total=0;
$x=$num;
while($x!=0)
{
    $rem=$x%10;
    $total=$total+$rem*$rem*$rem;
    $x=$x/10;
}
if($num==$total)
{
    echo "Yes it an Armstrong number";
}
else
{
    echo "Not an Armstrong Number";
}
?>

armstrong number program in php
Output :-

armstrong number check

armstrong number program using form php

Example :-



<form method="post">
    Enter number
    <input type="number" name="number"><br><br>
    <input type="submit" value="submit">
</form>
<?php
if($_POST)
{
    $num = $_POST['number'];
    $a=$num;
    $sum=0;
    while($a!= 0)
    {
        $rem = $a%10;
        $sum=$sum+($rem*$rem*$rem);
        $a =$a/10;
        }
        if($num==$sum)
         {
            echo " $num Yes Number is Armstrong Number";
         }
         else
         {
            echo " $num  Not Number is Armstrong Number";

         }
         }
    ?>

armstrong number program using form  php

Output :-

armstrong number check


Related Articles:-

php program to print alphabet pattern P

php program to print alphabet pattern C

Comments

Popular posts from this blog

CSS Text Color Explained with Syntax and HTML Examples

CSS Outline Offset Property with Practical Examples

Learn CSS text-decoration-color Property in Simple Words with Examples