Check Leap Year Program

if(isset($_POST['submit']))
 {
    $year=$_POST['year'];
    if($year%4==0)
          {
            $leap="It is a leap year";
          }
      else
         {
           $leap="It is not a leap year";
        }
}
 ?>
 


 
 Leap Year
 

 

 


 
 
   
           
   
 
 

Enter the year:  
   

 if(isset($_POST['submit'])){   
                        echo $leap;      }  
     
     ?>   
           

 

In this code output(It is not a leap year) is displaying before entering the input value.

the output should get after giving input value. how to solve it?

0   0
shubhangi kendre

Related Post

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site