Final answer:
In Raptor, the smallest and largest numbers can be found by utilizing 'min' and 'max' functions, sorting the array, using 'if' conditions, or iterating through the array.
Step-by-step explanation:
To find the smallest and largest number in Raptor, you can either:
- Utilize 'min' and 'max' functions: These functions directly return the smallest and largest values respectively.
- Sorting the array in ascending order: The first element will be the smallest, and the last element will be the largest after sorting.
- Using 'if' conditions within loops to compare elements and keep track of the smallest and largest numbers encountered.
- Iterating through the array: Keep updating two variables 'min' and 'max' with the smallest and largest values as you go through the array.
Among these options, using 'if' conditions and iterating through the array are more primitive methods and don't rely on built-in functions. Using these methods provides a deeper understanding of how comparisons are made programmatically to find the smallest and largest numbers in an array.