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

PHP using leap year program

 PHP Using leap year program 

PHP using leap year program


                       Leap Year 

1]  leap year is the one  has 366 days in a year.

2] leap year comes after every four years.

3]  leap year is always a multiple of four.

4] For example,1999,2000, 2007,2008,2009,2010, 2020, 2024, etc are leap years.


Q. Leap Year Program php

 Example

<?php
function isLeap($year)
{
    return(date('L',mktime(0,0,1,1, $year))==1);
}
    for($year=1991; $year<2016;$year++)
    {
        if(isLeap($year))
        {
            echo "$year : LEAP YEAR <br>\n";
        }
        else
        {
            echo "$year:Not leap year<br>\n";

        }
    }
?>

Q. leap year program php

    Output :

leap year program php


 Q. leap year program using  form php

    Example


<html>
    <form method="post">
        Enter the Year : <input type ="text"
name="year">
        <input type="submit" name="submit"
value="submit">
</form>
<?php
if($_POST)
{
    $year = $_POST['year'];
    if(!is_numeric($year))
    {
        echo "string not allowed,
Input should be a number";
        return;
    }
    if((0==$year %4 )and(0!=$year % 100)or
(0==$year%400))
    {
        echo "$year this number is a Leap Year";
    }
    else{
        echo "$year  this numberis not
a Leap Year";

    }
}
?>


Q. leap year program using  form php

    Output :



leap year program php

PHP using leap year program


READ MORE :-

php for loop

Alphabet triangle pattern

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