Write a PHP program that accepts six numbers as input and sorts them in descending order.
Input: Input consists of six numbers n1, n2, n3, n4, n5, n6 (-100000 ≤ n1, n2, n3, n4, n5, n6 ≤ 100000). The six numbers are separated by a space
<?php $stdin = trim(fgets(STDIN)); $nums = explode(" ", $stdin); rsort($nums); print("After sorting the said integers:\n"); echo implode(' ', $nums); ?>
Sample Output:
After sorting the said integers: 9 8 7 6 4 2
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer