Complete the code to check if a number is positive.
<?php $number = 5; if ($number [1] 0) { echo "Positive number"; } ?>
The condition $number > 0 checks if the number is positive.
Complete the code to print "Even" if the number is even.
<?php $number = 4; if ($number % 2 [1] 0) { echo "Even"; } ?>
The condition $number % 2 == 0 checks if the number is even.
Fix the error in the if-else statement to print "Positive" or "Non-positive".
<?php $number = -3; if ($number [1] 0) { echo "Positive"; } else { echo "Non-positive"; } ?>
The condition $number > 0 correctly checks for positive numbers.
Fill both blanks to check if a number is negative or zero.
<?php $number = 0; if ($number [1] 0) { echo "Negative number"; } elseif ($number [2] 0) { echo "Zero"; } else { echo "Positive number"; } ?>
The first condition $number < 0 checks for negative numbers, and the second $number == 0 checks for zero.
Fill both blanks to print "Small", "Medium", or "Large" based on the value.
<?php $value = 15; if ($value [1] 10) { echo "Small"; } elseif ($value [2] 20) { echo "Medium"; } else { echo "Large"; } ?>
The first condition $value < 10 prints "Small". The second $value <= 20 prints "Medium". Otherwise, it prints "Large".
