uprbnd1.cpp

We use cookies. Read the Privacy and Cookie Policy

uprbnd1.cpp

#include ‹stl.h›

#include ‹iostream.h›

int main() {

 int array[20];

 for (int i = 0; i ‹ 20; i++) {

  array[i] = i/4;

  cout ‹‹ array[i] ‹‹ ;

 }

 cout ‹‹ " 3 can be inserted at index: "

  ‹‹ upper_bound(array, array + 20, 3) - array ‹‹ endl;

 return 0;

}