PHP Exercises: Check if y is greater than x, and z is greater than y from three given integers x,y,z
47. Increasing Order Check for x,y,z
Write a PHP program to check if y is greater than x, and z is greater than y from three given integers x,y,z.
Sample Solution:
PHP Code :
Explanation:
- Function Definition:
- The function test checks if the numbers follow a strictly increasing order, i.e., $x < $y and $y < $z.
- Condition Checked:
- Condition: It returns true if $x is less than $y and $y is less than $z; otherwise, it returns false.
Output:
bool(true) bool(true) bool(false)
Visual Presentation:

Flowchart:

For more Practice: Solve these Related Problems:
- Write a PHP script to determine if three integers are in strictly increasing order (x < y < z).
- Write a PHP function to verify that the second number is greater than the first and the third is greater than the second using conditional operators.
- Write a PHP program to check the ordering of three numbers and return a boolean confirming proper ascending order.
- Write a PHP script to compare three inputs and output true only if they are arranged in increasing sequence, using comparison chains.
Go to:
PREV : Two Integers Sum to Third Check.
NEXT : Strict Increasing Order, Allow Equality Option.
PHP Code Editor:
Contribute your code and comments through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.