Conditional Rendering in React Complete Guide with Examples 2026

Image
  Conditional Rendering in React Conditional Rendering is one of the most useful concepts in React. It means showing different content on the screen depending on a condition. For example: If a user is logged in → show Logout If a user is not logged in → show Login If a student has passed → show Congratulations If a product is available → show Buy Now If data is loading → show Loading... React does not have a separate if rendering tag. Instead, we use normal JavaScript conditions such as if, the ternary operator, &&, and switch to decide what should appear in the UI.

php program check to even or odd number

Even odd Program


php even odd program

php even odd program

Information ::-

1]  Those EVEN Number  - 2,4,6,8,10 etc.
2] those divisible by 2 number .


1] Those ODD Number - 1,3,5,7,9,11 etc.
2]  Not divisible by  2 Number.

PHP Even Odd Program 

Example :-

<?php
$no=100;
if($no%2==0)
{
    echo"$no is even number";
}
else
{
  echo "$no is odd number";
}
?>

php even odd program

Output :-

php even odd program /output

Even odd Program using FORM in php 

Example :-



<form action="evenor-odd-form.php" method="get">
    <input type="number"  name="number" value="number" required>
    <input type="submit" value="show" name="b1">  
</form>
<?php

  if(isset($_GET['b1']))
  {
  /* input  */
  $no =$_GET ['number'];
 

  $result=($no %2==0)? "no even" :"no odd";
  echo "$result";
  }
  ?>

Even odd Program using FORM in php 

Output :-

php even odd program /output



Related Post :-

php else if ladder

line break html

how to create login forms 

Comments