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


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

    1. Admin Post author

      I think program is correct, for what input it is giving wrong answer?

      Reply
  1. Urvashi

    why don’t have you assigned large and small with 0 as it might take garbage value?

    Reply
  2. Swati

    Is this programm correct or not.because i am not satisfied this program output….

    Reply
  3. srinithi

    sum of except largest and smallest element in a array c programming

    Reply

Leave a Reply

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