Menu
Coddy logo textTech

Max and Min Element

Lesson 19 of 26 in Coddy's Arrays in C++ course.

challenge icon

Challenge

Given an array of size n , print the largest and the smallest element of the array using max and min function

Try it yourself

#include<iostream>
using namespace std;

int main(){
  
 int n;
 cin>>n;
int arr[n]; 

 for(int i=0;i<n;i++){
   cin>>arr[i];
 }
//Code here
.



    return 0;
}   

All lessons in Arrays in C++