#include <stdio.h>

int main()
{
    int arr[9] = {1, 2, 3, 4, 7, 4, 3, 2, 1};
    int max = arr[0];
    int min = arr[0];

    for (int i = 0; i < 9; i++)
    {
        if (arr[i] > max)
        {
            max = arr[i];
        }
        else if (arr[i] < min)
        {
            min = arr[i];
        }
    }

    printf("The maximum number is %d\n", max);
    printf("The minimum number is %d\n", min);
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: