C Program to Find Largest and Smallest Element in Array

Here is the C program to find the largest and smallest element in a one dimensional (1-D) array.

 

Output

How many elements:5
Enter the Array:1 8 12 4 6
The largest element is 12
The smallest element is 1

23 thoughts on “C Program to Find Largest and Smallest Element in Array”

  1. 2 questions:

    1. How can I use this to compute difference between maximum and minimum

    2. How do I make it so when I input array, it is separated by commas

Leave a Comment

Your email address will not be published. Required fields are marked *