पूर्णांकों की एक सरणी को देखते हुए, एक प्रोग्राम लिखें जो अधिकतम और न्यूनतम मान पाता है।[7, 9, 5, 4, 6, 8]
max_num = 0
min_num = 10000000 # assuming a very large number as minimum initially

num_list = [7, 9, 5, 4, 6, 8] # Given list of numbers

for num in num_list:
    if num > max_num:
        max_num = num # If the current number is greater than the maximum number, replace the maximum number with the current number
    if num < min_num:
        min_num = num # If the current number is less than the minimum number, replace the minimum number with the current number

print("Maximum number is:", max_num)
print("Minimum number is:", min_num)