To find the biggest number in an array without using the max function, you can initialize a variable to hold the largest number, typically starting with the first element of the array. Then, iterate through the array using a loop, and for each element, compare it with the current largest number. If the current element is greater, update the largest number. Finally, after the loop, the variable will contain the largest number in the array. Here’s a simple example:
<code class="language-python">arr = [3, 5, 2, 9, 1]largest = arr[0] for num in arr: if num > largest: largest = num print(largest) # Output: 9
</code>
Copyright © 2026 eLLeNow.com All Rights Reserved.