Max and Min Element
Lesson 19 of 26 in Coddy's Arrays in C++ course.
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++
7Array Challenges
Reverse an ArraySmallest Positive MissingTranspose of MatrixAddition of Two MatrixMax and Min ElementCheck Palindrome2Memory Analysis
Memory Allocation