@monif64

Century Year

August 01, 2020 · PHP
<?php
$year = 2000;

if($year % 100 == 0)
{
    echo "$year is a century year";
}

if($year % 100 != 0)
{
    echo "$year is not a century year";

Eligible to Vote?

August 01, 2020 · PHP
<?php
$current_age = 15;

if($current_age >=18)
{
    echo "You are $current_age. You are eligible to vote. Congrats.";
}

if($current_age < 18)
{
    echo "You are $current_age. You are not eligible to vote. Sorry.";

Number is Odd or Even

updated August 01, 2020 · PHP
<?php
$number = 12;

if($number % 2 == 0)
{
  echo "$number is divisible by 2 and is an even number";  
}

if($number % 2 != 0)
{
    echo "$number is not divisible by 2 and is an odd number";

Student Passed or Failed

updated August 01, 2020 · PHP
<?php
$studentGrade = 30; 

if($studentGrade >= 40) {
    echo "You Passed";
}

if($studentGrade < 40) {
    echo "You Failed";
}
?>