Program to find Maximum and Minimum element in Array C++

How it Works:

  • Declare array of size 10
  • Using for loop assign array indexes with random values between 1 and 1000.
  • Call the function and pass array and its size as argument.
  • Function declares two integers max and min and assign both integers with arrays first index value.
  • Then with in for loop there are two if condition first check is for minimum number and second check is for maximum number.
  • Finally program display the output values of both integers min and max.

Following is the program to find maximum and minimum element in array

 

Be the first to comment

Leave a Reply