Find the Largest and Smallest Elements in a 1-D Array in C
This program finds the largest and smallest elements in a one-dimensional array by scanning through it once and keeping track of the current maximum and minimum. C Program #include <stdio.h> int main() { int n, i; int arr[100]; printf(“Enter number of elements: “); scanf(“%d”, &n); printf(“Enter %d elements: “, n); for (i = 0; i … Read more