#include #define MAX_SIZE 20 void getNums(int[], int*); int smallest(int[], int); int main() { int numbers[MAX_SIZE]; int count = 0; getNums(numbers, &count); printf("The smallest number is %d\n", smallest(numbers, count)); return 0; } void getNums(int nums[], int* cnt) { int nextNum; printf("Enter numbers (end with -1): "); scanf("%d", &nextNum); while (nextNum != -1 && *cnt < MAX_SIZE) { nums[*cnt] = nextNum; (*cnt)++; scanf("%d", &nextNum); } } int smallest(int nums[], int cnt) { int small = nums[0]; int i; for (i = 1; i < cnt; i++) { if (nums[i] < small) { small = nums[i]; } } return small; }