how to get the lowest number on a array in c

To get the lowest number in an array in C, you can use a simple loop to compare each element with the current minimum value. Here's an example code snippet:

#include <stdio.h>

int main() {
    int arr[] = {5, 3, 8, 1, 9};
    int size = sizeof(arr) / sizeof(arr[0]);
    int min = arr[0];

    for (int i = 1; i < size; i++) {
        if (arr[i] < min) {
            min = arr[i];
        }
    }

    printf("The lowest number in the array is: %d\n", min);

    return 0;
}

In this example, we initialize the min variable with the first element of the array. Then, we iterate through the remaining elements of the array, comparing each element with the current minimum value. If we find an element that is smaller than the current minimum, we update the min variable to that element. Finally, we print the value of min as the lowest number in the array.

Note: The code assumes that all elements in the array are of the same type (integers in this case). If you have an array of a different type, you may need to adjust the code accordingly.