Search
 
SCRIPT & CODE EXAMPLE
 

CPP

find largest number in vector c++

#include <algorithm> // max_element
#include <vector> 
#include <iostream> // cout 
using namespace std;
int main(){
  vector<int> v1{ 10, 20, 30, 40, 50, 25, 15 };
  cout << *max_element(v1.begin(), v1.end());
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: latex piecewise function 
Cpp :: c++ starter 
Cpp :: Prime Number Checker 
Cpp :: no indentation latex 
Cpp :: qdebug 
Cpp :: isprime c++ 
Cpp :: print 2d vector c++ 
Cpp :: flutter convert datetime in day of month 
Cpp :: shuffle vector c++ 
Cpp :: c++ reverse vector 
Cpp :: string to vector c++ 
Cpp :: messagebox windows 
Cpp :: c++ get length of array 
Cpp :: remove all element of vector c++ 
Cpp :: eosio check account exist 
Cpp :: c++ write to file 
Cpp :: grpah class data structure 
Cpp :: C++ Area of Scalene Triangle 
Cpp :: std string to wstring 
Cpp :: gestd::getline with wstring 
Cpp :: creator of C++ 
Cpp :: what is time complexity of min_element() 
Cpp :: c++ in linux 
Cpp :: casting pointer (int to char*) in c++ 
Cpp :: convert a int to string c++ 
Cpp :: resize two dimensional vector c++ 
Cpp :: c++ vector iterator 
Cpp :: 2d vector c++ declaration 
Cpp :: what is the difference between i++ and ++ i ? 
Cpp :: c++ declaring and initializing strings 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =